bpo-39057: Fix urllib.request.proxy_bypass_environment(). (GH-17619)

Ignore leading dots and no longer ignore a trailing newline.
This commit is contained in:
Serhiy Storchaka 2020-01-05 14:14:31 +02:00 committed by GitHub
parent ec007cb43f
commit 6a265f0d0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 39 additions and 13 deletions

View file

@ -1056,9 +1056,9 @@ def _splitport(host):
"""splitport('host:port') --> 'host', 'port'."""
global _portprog
if _portprog is None:
_portprog = re.compile('(.*):([0-9]*)$', re.DOTALL)
_portprog = re.compile('(.*):([0-9]*)', re.DOTALL)
match = _portprog.match(host)
match = _portprog.fullmatch(host)
if match:
host, port = match.groups()
if port: