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
9e6b97502f
commit
1e440cf5a2
6 changed files with 21 additions and 15 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue