From: Guido van Rossum Date: Wed, 16 Apr 1997 15:17:06 +0000 (+0000) Subject: spliturl() should not throw away everything past first newline X-Git-Tag: v1.5a1~142 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ab0d1afdf3f29bbc4e822b75dc93999c61c67b2d;p=thirdparty%2FPython%2Fcpython.git spliturl() should not throw away everything past first newline --- diff --git a/Lib/urllib.py b/Lib/urllib.py index a8a579bb9061..d241ad46ff35 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('^//\([^/]+\)\(.*\)$')