]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix SF bug [ #416231 ] urllib.basejoin fails to apply some ../.
authorGuido van Rossum <guido@python.org>
Sun, 15 Apr 2001 20:47:33 +0000 (20:47 +0000)
committerGuido van Rossum <guido@python.org>
Sun, 15 Apr 2001 20:47:33 +0000 (20:47 +0000)
Reported by Juan M. Bello Rivas.

Lib/urllib.py

index 3175199a96ab6eae7721d078cbd4d7afe1ba47a3..53005c8d8d5a17704987a71e2b6cedab6a3209b3 100644 (file)
@@ -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