CarlEdman / godaddy-ddns

A script for dynamically updating a GoDaddy DNS record. I use GoDaddy to host DNS for a domain and I wanted to point an A record in that domain to a host who's IP address changes occasionally. GoDaddy has an API to do this, so this happened. Cf. thatjpk/cloudflare-ddns.
The Unlicense
197 stars 61 forks source link

Interesting Error #8

Closed JP2828 closed 5 years ago

JP2828 commented 5 years ago

I am now getting this error after going to Centos7

[root@padin ~]# /root/godaddy_updater.py %/root/godaddy-ddns.config

Traceback (most recent call last): File "/root/godaddy_updater.py", line 141, in main() File "/root/godaddy_updater.py", line 84, in main with urlopen("http://ipv4.icanhazip.com/") as f: resp=f.read() AttributeError: addinfourl instance has no attribute 'exit' [root@padin ~]#

CarlEdman commented 5 years ago

That is probably an effect of the version of python used. In Python 3, urlopen() returns a context handler which can be used with 'with'. In at least some versions of Python 2, it doesn't. For a discussion with respect to 2.7 only, see here.