summaryrefslogtreecommitdiff
path: root/Lib/urllib/parse.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2020-01-05 14:14:31 +0200
committerGitHub <noreply@github.com>2020-01-05 14:14:31 +0200
commit6a265f0d0c0a4b3b8fecf4275d49187a384167f4 (patch)
tree238eefb63cc4523147fcd84151954f37ffbfd15a /Lib/urllib/parse.py
parentec007cb43faf5f33d06efbc28152c7fdcb2edb9c (diff)
downloadcpython-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.py4
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: