Commit 5f999b9c authored by Denis Bilenko's avatar Denis Bilenko

Fixed issue #132: gethostbyname(unicode) now does ascii encoding and uses...

Fixed issue #132: gethostbyname(unicode) now does ascii encoding and uses gevent's resolver rather than calling built-in resolver
parent 9e3966c7
......@@ -679,6 +679,8 @@ else:
# TODO: this is supposed to iterate through all the addresses
# could use a global dict(hostname, iter)
# - fix these nasty hacks for localhost, ips, etc.
if isinstance(hostname, unicode):
hostname = str(hostname)
if not isinstance(hostname, str) or '.' not in hostname:
return _socket.gethostbyname(hostname)
if _ip4_re.match(hostname):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment