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

Michael Hudson mwh@users.sourceforge.net
Fri, 05 Apr 2002 07:35:37 -0800


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

Modified Files:
      Tag: release22-maint
	urllib.py 
Log Message:
Backport both bits of Guido's fix for bug #503031.


Index: urllib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/urllib.py,v
retrieving revision 1.135.6.1
retrieving revision 1.135.6.2
diff -C2 -d -r1.135.6.1 -r1.135.6.2
*** urllib.py	18 Mar 2002 22:19:24 -0000	1.135.6.1
--- urllib.py	5 Apr 2002 15:35:35 -0000	1.135.6.2
***************
*** 1281,1285 ****
                      for p in proxyServer.split(';'):
                          protocol, address = p.split('=', 1)
!                         proxies[protocol] = '%s://%s' % (protocol, address)
                  else:
                      # Use one setting for all protocols
--- 1281,1289 ----
                      for p in proxyServer.split(';'):
                          protocol, address = p.split('=', 1)
!                         # 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