Fix Issue2244 - urllib unquotes user and password info multiple times - Patch by Theodore Turocy
diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py
index 38efd50..2ddd281 100644
--- a/Lib/urllib/parse.py
+++ b/Lib/urllib/parse.py
@@ -711,7 +711,7 @@
_userprog = re.compile('^(.*)@(.*)$')
match = _userprog.match(host)
- if match: return map(unquote, match.group(1, 2))
+ if match: return match.group(1, 2)
return None, host
_passwdprog = None
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index 9674b96..f3fb7be 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -1300,8 +1300,8 @@
else:
passwd = None
host = unquote(host)
- user = unquote(user or '')
- passwd = unquote(passwd or '')
+ user = user or ''
+ passwd = passwd or ''
try:
host = socket.gethostbyname(host)