mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
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.
This commit is contained in:
parent
13423c3726
commit
f6fbf56071
6 changed files with 24 additions and 14 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue