Commit 967c7442 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)
parent 3861a07b
......@@ -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