diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2020-01-05 14:14:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-05 14:14:31 +0200 |
commit | 6a265f0d0c0a4b3b8fecf4275d49187a384167f4 (patch) | |
tree | 238eefb63cc4523147fcd84151954f37ffbfd15a /Lib/urllib/parse.py | |
parent | ec007cb43faf5f33d06efbc28152c7fdcb2edb9c (diff) | |
download | cpython-git-6a265f0d0c0a4b3b8fecf4275d49187a384167f4.tar.gz |
bpo-39057: Fix urllib.request.proxy_bypass_environment(). (GH-17619)
Ignore leading dots and no longer ignore a trailing newline.
Diffstat (limited to 'Lib/urllib/parse.py')
-rw-r--r-- | Lib/urllib/parse.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py index 31fd7e16ee..34d5f95dd7 100644 --- a/Lib/urllib/parse.py +++ b/Lib/urllib/parse.py @@ -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: |