From e53b4a54c67134f795f694d88611867d93dd2cab Mon Sep 17 00:00:00 2001 From: "Michael W. Hudson" Date: Fri, 5 Apr 2002 15:35:35 +0000 Subject: [PATCH] Backport both bits of Guido's fix for bug #503031. --- Lib/urllib.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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:': -- 2.47.3