mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
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.
This commit is contained in:
parent
dfd59e039a
commit
b955d6c41e
1 changed files with 5 additions and 1 deletions
|
@ -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:':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue