summaryrefslogtreecommitdiffstats
path: root/Lib/urllib.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-04-15 20:47:33 (GMT)
committerGuido van Rossum <guido@python.org>2001-04-15 20:47:33 (GMT)
commitb8bf3bece2e30b9402fc3c48c134c59903952c21 (patch)
tree6118cdd8cb5530da58ac05c5fb34718bb82607be /Lib/urllib.py
parent9c7eab82b3ccf25dda907bf5680d70d4d68a24b8 (diff)
downloadcpython-b8bf3bece2e30b9402fc3c48c134c59903952c21.zip
cpython-b8bf3bece2e30b9402fc3c48c134c59903952c21.tar.gz
cpython-b8bf3bece2e30b9402fc3c48c134c59903952c21.tar.bz2
Fix SF bug [ #416231 ] urllib.basejoin fails to apply some ../.
Reported by Juan M. Bello Rivas.
Diffstat (limited to 'Lib/urllib.py')
-rw-r--r--Lib/urllib.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py
index 3175199..53005c8 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -863,6 +863,8 @@ def basejoin(base, url):
basepath = ''
path = basepath + path
+ if host and path and path[0] != '/':
+ path = '/' + path
if type and host: return type + '://' + host + path
elif type: return type + ':' + path
elif host: return '//' + host + path # don't know what this means