From: Ben Darnell Date: Thu, 24 Jan 2013 03:35:16 +0000 (-0500) Subject: Document --disable-ipv6 fix and only apply it when family==AF_UNSPEC. X-Git-Tag: v3.0.0~154 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=efae6e04dfe6bd5725ccfd7521b6dc65c96c503b;p=thirdparty%2Ftornado.git Document --disable-ipv6 fix and only apply it when family==AF_UNSPEC. --- diff --git a/tornado/netutil.py b/tornado/netutil.py index 0d711d4d9..1a80d5de8 100644 --- a/tornado/netutil.py +++ b/tornado/netutil.py @@ -53,7 +53,12 @@ def bind_sockets(port, address=None, family=socket.AF_UNSPEC, backlog=128, flags sockets = [] if address == "": address = None - if not socket.has_ipv6: + if not socket.has_ipv6 and family == socket.AF_UNSPEC: + # Python can be compiled with --disable-ipv6, which causes + # operations on AF_INET6 sockets to fail, but does not + # automatically exclude those results from getaddrinfo + # results. + # http://bugs.python.org/issue16208 family = socket.AF_INET if flags is None: flags = socket.AI_PASSIVE diff --git a/website/sphinx/releases/next.rst b/website/sphinx/releases/next.rst index 013d1b0ed..cd15401fb 100644 --- a/website/sphinx/releases/next.rst +++ b/website/sphinx/releases/next.rst @@ -228,3 +228,6 @@ In progress port available in 12.10 (``apt-get install python3-pycurl``). This port currently has bugs that prevent it from handling arbitrary binary data but it should work for textual (utf8) resources. +* `tornado.netutil.bind_sockets` now works when Python was compiled + with ``--disable-ipv6`` but IPv6 DNS resolution is available on the + system.