summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2002-03-31 23:38:48 (GMT)
committerGuido van Rossum <guido@python.org>2002-03-31 23:38:48 (GMT)
commitb955d6c41e80806c8390dba47323ef7fc41f05aa (patch)
tree47e6148096633baa59e568f389f8c0bd2105f30b /Lib
parentdfd59e039a5e070fd6fc8ec4de749c84f9535823 (diff)
downloadcpython-b955d6c41e80806c8390dba47323ef7fc41f05aa.zip
cpython-b955d6c41e80806c8390dba47323ef7fc41f05aa.tar.gz
cpython-b955d6c41e80806c8390dba47323ef7fc41f05aa.tar.bz2
Hopeful fix for SF bug 503031: urllib.py: open_http() host problem.
I really can't test this, but from reading the discussion in that bug report, it's likely that this works. It may also close a whole bunch of other bug reports related to urllib and proxies on Windows, but who knows.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/urllib.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py
index 2ba5590..123642a 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -1278,7 +1278,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
+ type, address = splittype(address)
+ if not type:
+ address = '%s://%s' % (protocol, address)
+ proxies[protocol] = address
else:
# Use one setting for all protocols
if proxyServer[:5] == 'http:':