summaryrefslogtreecommitdiffstats
path: root/Lib/urllib.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/urllib.py')
-rw-r--r--Lib/urllib.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py
index 136f42e..d65c0b0 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -442,9 +442,9 @@ class URLopener:
return addinfourl(fp, noheaders(), "gopher:" + url)
def open_file(self, url):
+ """Use local file or FTP depending on form of URL."""
if not isinstance(url, str):
raise IOError, ('file error', 'proxy support for file protocol currently not implemented')
- """Use local file or FTP depending on form of URL."""
if url[:2] == '//' and url[2:3] != '/' and url[2:12].lower() != 'localhost/':
return self.open_ftp(url)
else:
@@ -1032,7 +1032,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)