From: Michael W. Hudson Date: Fri, 5 Apr 2002 15:35:35 +0000 (+0000) Subject: Backport both bits of Guido's fix for bug #503031. X-Git-Tag: v2.2.1~16 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e53b4a54c67134f795f694d88611867d93dd2cab;p=thirdparty%2FPython%2Fcpython.git Backport both bits of Guido's fix for bug #503031. --- diff --git a/Lib/urllib.py b/Lib/urllib.py index 2318a4c7395e..002ac515630a 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -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:':