]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Modify splituser() method to allow an @ in the userinfo field.
authorRaymond Hettinger <python@rcn.com>
Sun, 18 Aug 2002 20:10:08 +0000 (20:10 +0000)
committerRaymond Hettinger <python@rcn.com>
Sun, 18 Aug 2002 20:10:08 +0000 (20:10 +0000)
Jeremy reported that this is not allowed by RFC 2396; however,
other tools support unescaped @'s so we should also.

Apply SF patch 596581 closing bug 581529.

Lib/urllib.py

index 8188d4806f592e203a3d0bc9d08c9f816a8e94de..d30fbb9de5dc4e79d513c4f09f58481756bf384a 100644 (file)
@@ -954,7 +954,7 @@ def splituser(host):
     global _userprog
     if _userprog is None:
         import re
-        _userprog = re.compile('^([^@]*)@(.*)$')
+        _userprog = re.compile('^(.*)@(.*)$')
 
     match = _userprog.match(host)
     if match: return map(unquote, match.group(1, 2))