summaryrefslogtreecommitdiffstatshomepage
path: root/Lib/urllib/parse.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/urllib/parse.py')
-rw-r--r--Lib/urllib/parse.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py
index b437d6f43ba..cfd47f9d92b 100644
--- a/Lib/urllib/parse.py
+++ b/Lib/urllib/parse.py
@@ -688,7 +688,12 @@ def splithost(url):
_hostprog = re.compile('^//([^/?]*)(.*)$')
match = _hostprog.match(url)
- if match: return match.group(1, 2)
+ if match:
+ host_port = match.group(1)
+ path = match.group(2)
+ if path and not path.startswith('/'):
+ path = '/' + path
+ return host_port, path
return None, url
_userprog = None