summaryrefslogtreecommitdiffstats
path: root/Lib/test/support
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2013-08-21 22:39:46 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2013-08-21 22:39:46 (GMT)
commit1e440cf5a267ce1787aa048525d45eb56fc06135 (patch)
tree4ffa3bf47f07f129bf502d6c1cc081190f642abe /Lib/test/support
parent9e6b97502f3a0c5f7d24e0b7f05dc9b41b0d0b85 (diff)
downloadcpython-1e440cf5a267ce1787aa048525d45eb56fc06135.zip
cpython-1e440cf5a267ce1787aa048525d45eb56fc06135.tar.gz
cpython-1e440cf5a267ce1787aa048525d45eb56fc06135.tar.bz2
Issue #18792: Use "127.0.0.1" or "::1" instead of "localhost" as much as possible, since "localhost" goes through a DNS lookup under recent Windows versions.
Diffstat (limited to 'Lib/test/support')
-rw-r--r--Lib/test/support/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index 0b3bd68..1c6ee03 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -479,7 +479,11 @@ def requires_mac_ver(*min_version):
return decorator
-HOST = 'localhost'
+# Don't use "localhost", since resolving it uses the DNS under recent
+# Windows versions (see issue #18792).
+HOST = "127.0.0.1"
+HOSTv6 = "::1"
+
def find_unused_port(family=socket.AF_INET, socktype=socket.SOCK_STREAM):
"""Returns an unused port that should be suitable for binding. This is