]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Specify a non-zero port when testing localhost resolution.
authorBen Darnell <ben@bendarnell.com>
Tue, 12 Aug 2014 12:51:27 +0000 (08:51 -0400)
committerBen Darnell <ben@bendarnell.com>
Tue, 12 Aug 2014 12:55:03 +0000 (08:55 -0400)
Some getaddrinfo implementations (including OS X 10.6) fail
if we try to resolve port 0 without AI_PASSIVE.

Closes #1136.

tornado/test/tcpclient_test.py

index a9dfe5a5af9e01de393a123ad949a89e2ec4f769..5df4a7abb30e398eebb247da67bf18ad2a1dcb4b 100644 (file)
@@ -72,7 +72,9 @@ class TCPClientTest(AsyncTestCase):
         super(TCPClientTest, self).tearDown()
 
     def skipIfLocalhostV4(self):
-        Resolver().resolve('localhost', 0, callback=self.stop)
+        # The port used here doesn't matter, but some systems require it
+        # to be non-zero if we do not also pass AI_PASSIVE.
+        Resolver().resolve('localhost', 80, callback=self.stop)
         addrinfo = self.wait()
         families = set(addr[0] for addr in addrinfo)
         if socket.AF_INET6 not in families: