]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport both bits of Guido's fix for bug #503031.
authorMichael W. Hudson <mwh@python.net>
Fri, 5 Apr 2002 15:35:35 +0000 (15:35 +0000)
committerMichael W. Hudson <mwh@python.net>
Fri, 5 Apr 2002 15:35:35 +0000 (15:35 +0000)
Lib/urllib.py

index 2318a4c7395ec328962857d61a7bca854435b6cc..002ac515630a65490a190b4541ef70422499d192 100644 (file)
@@ -1280,7 +1280,11 @@ elif os.name == 'nt':
                     # Per-protocol settings
                     for p in proxyServer.split(';'):
                         protocol, address = p.split('=', 1)
-                        proxies[protocol] = '%s://%s' % (protocol, address)
+                        # See if address has a type:// prefix
+                        import re
+                        if not re.match('^([^/:]+)://', address):
+                            address = '%s://%s' % (protocol, address)
+                        proxies[protocol] = address
                 else:
                     # Use one setting for all protocols
                     if proxyServer[:5] == 'http:':