Commits

Denis Bilenko committed 1fab1da

Fixed issue #132: gethostbyname(unicode) now does ascii encoding and uses gevent's resolver rather than calling built-in resolver

  • Participants
  • Parent commits 51828dc

Comments (0)

Files changed (1)

File gevent/socket.py

         # 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):