Commit 59f0b91b authored by Denis Bilenko's avatar Denis Bilenko

socket: fix getaddrinfo to handle international domain names (instead of...

socket: fix getaddrinfo to handle international domain names (instead of calling stdlib's getaddrinfo)

--HG--
extra : transplant_source : %F6%A6E%E0%04_%ED%0B%00%3E%C2a%2B%C1AG%3F%9B%DD%A3
parent d03f69eb
......@@ -695,6 +695,8 @@ else:
to :mod:`dns` functions.
"""
family, socktype, proto, _flags = args + (None, ) * (4 - len(args))
if isinstance(host, unicode):
host = host.encode('idna')
if not isinstance(host, str) or '.' not in host or _ip4_re.match(host):
return _socket.getaddrinfo(host, port, *args)
......
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