]> granicus.if.org Git - python/commitdiff
Sjoerd Mullender:
authorGuido van Rossum <guido@python.org>
Thu, 1 Jul 1999 23:20:56 +0000 (23:20 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 1 Jul 1999 23:20:56 +0000 (23:20 +0000)
In splithost, accept empty host part in URLs.  This is required for
file URLs that can have an empty host part.  For such URLs, we should
not return the initial 2 slashes as part of the file name.

Lib/urllib.py

index c12f4519cca646422c3918c0c9354d31bb94a59b..ad1e791386ccfdbc740d2db24600c089e20306f6 100644 (file)
@@ -773,7 +773,7 @@ def splithost(url):
     global _hostprog
     if _hostprog is None:
         import re
-        _hostprog = re.compile('^//([^/]+)(.*)$')
+        _hostprog = re.compile('^//([^/]*)(.*)$')
 
     match = _hostprog.match(url) 
     if match: return match.group(1, 2)