From 6a265f0d0c0a4b3b8fecf4275d49187a384167f4 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sun, 5 Jan 2020 14:14:31 +0200 Subject: bpo-39057: Fix urllib.request.proxy_bypass_environment(). (GH-17619) Ignore leading dots and no longer ignore a trailing newline. --- Lib/urllib/parse.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Lib/urllib/parse.py') 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: -- cgit v1.2.1