diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2013-08-21 22:39:46 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2013-08-21 22:39:46 (GMT) |
commit | f6fbf5607155b2dcd517059c8067305c4d015b00 (patch) | |
tree | 49d363b0218c7c9d8c36a64f029ca45ed49cf905 /Lib/test/support | |
parent | 13423c3726ac4aa42125ac49e6c5038a015fe3eb (diff) | |
download | cpython-f6fbf5607155b2dcd517059c8067305c4d015b00.zip cpython-f6fbf5607155b2dcd517059c8067305c4d015b00.tar.gz cpython-f6fbf5607155b2dcd517059c8067305c4d015b00.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__.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index befbe8b..02ea298 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -480,7 +480,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 |