Alan Gauld
2015-10-02 23:51:37 UTC
socket.gaierror: [Errno 11004] getaddrinfo failed
...ResolveHostname = socket.gethostbyname(name)
print(ResolveHostname)
newFile.write(ResolveHostname + "\n")
print(ResolveHostname)
newFile.write("No resolution available for %s" % (name) + "\n")
You are catching herror but your code is resulting in gaierror.print(ResolveHostname)
newFile.write(ResolveHostname + "\n")
print(ResolveHostname)
newFile.write("No resolution available for %s" % (name) + "\n")
Add socket.gaierror to your except line.
except (socket.herror, socket.gaierror):
newFile.write("No resolution available for %s" % (name) + "\n")
see if that works
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
_______________________________________________
Tutor maillist - ***@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor