[Python-checkins] CVS: python/dist/src/Lib urllib.py,1.139,1.140

Guido van Rossum gvanrossum@users.sourceforge.net
Sun, 31 Mar 2002 15:38:50 -0800


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv10390

Modified Files:
	urllib.py 
Log Message:
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.


Index: urllib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/urllib.py,v
retrieving revision 1.139
retrieving revision 1.140
diff -C2 -d -r1.139 -r1.140
*** urllib.py	26 Mar 2002 16:25:01 -0000	1.139
--- urllib.py	31 Mar 2002 23:38:48 -0000	1.140
***************
*** 1279,1283 ****
                      for p in proxyServer.split(';'):
                          protocol, address = p.split('=', 1)
!                         proxies[protocol] = '%s://%s' % (protocol, address)
                  else:
                      # Use one setting for all protocols
--- 1279,1287 ----
                      for p in proxyServer.split(';'):
                          protocol, address = p.split('=', 1)
!                         # 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