summaryrefslogtreecommitdiffstats
path: root/Lib/urlparse.py
diff options
context:
space:
mode:
authorMichael W. Hudson <mwh@python.net>2002-03-18 13:06:00 (GMT)
committerMichael W. Hudson <mwh@python.net>2002-03-18 13:06:00 (GMT)
commitbd3e771a979de04e273f735e69fb8842006137be (patch)
tree9af3ccf4b84b034358b9ee4c23be964c2481b5ba /Lib/urlparse.py
parent5c137c225113764faae183034e7a85175a699ae2 (diff)
downloadcpython-bd3e771a979de04e273f735e69fb8842006137be.zip
cpython-bd3e771a979de04e273f735e69fb8842006137be.tar.gz
cpython-bd3e771a979de04e273f735e69fb8842006137be.tar.bz2
amk's fix attached to
[ 516299 ] urlparse can get fragments wrong
Diffstat (limited to 'Lib/urlparse.py')
-rw-r--r--Lib/urlparse.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/urlparse.py b/Lib/urlparse.py
index cd6ad26..ee99645 100644
--- a/Lib/urlparse.py
+++ b/Lib/urlparse.py
@@ -87,7 +87,9 @@ def urlsplit(url, scheme='', allow_fragments=1):
if url[:2] == '//':
i = url.find('/', 2)
if i < 0:
- i = len(url)
+ i = url.find('#')
+ if i < 0:
+ i = len(url)
netloc = url[2:i]
url = url[i:]
if allow_fragments and '#' in url: