diff options
author | Guido van Rossum <guido@python.org> | 2008-01-05 01:21:57 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2008-01-05 01:21:57 (GMT) |
commit | ced4eb06e4fe528c99b34f4167011f8908c933af (patch) | |
tree | 81df17697d1f748fc75bc0c081104a932bf70bae /Lib/urlparse.py | |
parent | 3b83549ea0b0c3e8d1919925a8875052e13367cf (diff) | |
download | cpython-ced4eb06e4fe528c99b34f4167011f8908c933af.zip cpython-ced4eb06e4fe528c99b34f4167011f8908c933af.tar.gz cpython-ced4eb06e4fe528c99b34f4167011f8908c933af.tar.bz2 |
Patch #1698 by Senthil: allow '@' in username when parsed by urlparse.py.
Diffstat (limited to 'Lib/urlparse.py')
-rw-r--r-- | Lib/urlparse.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/urlparse.py b/Lib/urlparse.py index ad5d75f..4bf0af3 100644 --- a/Lib/urlparse.py +++ b/Lib/urlparse.py @@ -82,7 +82,7 @@ class BaseResult(tuple): def username(self): netloc = self.netloc if "@" in netloc: - userinfo = netloc.split("@", 1)[0] + userinfo = netloc.rsplit("@", 1)[0] if ":" in userinfo: userinfo = userinfo.split(":", 1)[0] return userinfo @@ -92,7 +92,7 @@ class BaseResult(tuple): def password(self): netloc = self.netloc if "@" in netloc: - userinfo = netloc.split("@", 1)[0] + userinfo = netloc.rsplit("@", 1)[0] if ":" in userinfo: return userinfo.split(":", 1)[1] return None @@ -101,7 +101,7 @@ class BaseResult(tuple): def hostname(self): netloc = self.netloc if "@" in netloc: - netloc = netloc.split("@", 1)[1] + netloc = netloc.rsplit("@", 1)[1] if ":" in netloc: netloc = netloc.split(":", 1)[0] return netloc.lower() or None @@ -110,7 +110,7 @@ class BaseResult(tuple): def port(self): netloc = self.netloc if "@" in netloc: - netloc = netloc.split("@", 1)[1] + netloc = netloc.rsplit("@", 1)[1] if ":" in netloc: port = netloc.split(":", 1)[1] return int(port, 10) |