]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
spliturl() should not throw away everything past first newline
authorGuido van Rossum <guido@python.org>
Wed, 16 Apr 1997 15:17:06 +0000 (15:17 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 16 Apr 1997 15:17:06 +0000 (15:17 +0000)
Lib/urllib.py

index a8a579bb90617748cbae52a8e64d7b1aa45192c5..d241ad46ff35c5900e65f43deb738a55047490c9 100644 (file)
@@ -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('^//\([^/]+\)\(.*\)$')