summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-04-16 15:17:06 (GMT)
committerGuido van Rossum <guido@python.org>1997-04-16 15:17:06 (GMT)
commitab0d1afdf3f29bbc4e822b75dc93999c61c67b2d (patch)
tree113d67b93e9a217adf34d64a3b20bfcd9cc3f45a /Lib
parentb2c02de9cb9df1fbd9764ce51b69ba31fb5c9570 (diff)
downloadcpython-ab0d1afdf3f29bbc4e822b75dc93999c61c67b2d.zip
cpython-ab0d1afdf3f29bbc4e822b75dc93999c61c67b2d.tar.gz
cpython-ab0d1afdf3f29bbc4e822b75dc93999c61c67b2d.tar.bz2
spliturl() should not throw away everything past first newline
Diffstat (limited to 'Lib')
-rw-r--r--Lib/urllib.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py
index a8a579b..d241ad4 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -629,9 +629,11 @@ def unwrap(url):
if url[:4] == 'URL:': url = string.strip(url[4:])
return url
-_typeprog = regex.compile('^\([^/:]+\):\(.*\)$')
+_typeprog = regex.compile('^\([^/:]+\):')
def splittype(url):
- if _typeprog.match(url) >= 0: return _typeprog.group(1, 2)
+ if _typeprog.match(url) >= 0:
+ scheme = _typeprog.group(1)
+ return scheme, url[len(scheme) + 1:]
return None, url
_hostprog = regex.compile('^//\([^/]+\)\(.*\)$')