Commits

Benoit Boissinot committed cadd7e0

url: correctly quote '/' in user and password embedded in urls

Comments (0)

Files changed (1)

     else:
         hostport = host
     if user:
+        quote = lambda s: urllib.quote(s, safe='')
         if passwd:
-            userpass = urllib.quote(user) + ':' + urllib.quote(passwd)
+            userpass = quote(user) + ':' + quote(passwd)
         else:
-            userpass = urllib.quote(user)
+            userpass = quote(user)
         return userpass + '@' + hostport
     return hostport