[Python-checkins] python/dist/src/Lib urlparse.py,1.32,1.33

nnorwitz@users.sourceforge.net nnorwitz@users.sourceforge.net
Wed, 25 Sep 2002 12:20:14 -0700


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

Modified Files:
	urlparse.py 
Log Message:
Fix SF # 591713, Fix "file:" URL to have right no. of /'s, by Bruce Atherton

Add a test too.  urljoin() would make file:/tmp/foo instead of file:///tmp/foo

Bugfix candidate, I will backport.


Index: urlparse.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/urlparse.py,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** urlparse.py	18 Mar 2002 13:06:00 -0000	1.32
--- urlparse.py	25 Sep 2002 19:20:10 -0000	1.33
***************
*** 129,133 ****
  
  def urlunsplit((scheme, netloc, url, query, fragment)):
!     if netloc or (scheme in uses_netloc and url[:2] == '//'):
          if url and url[:1] != '/': url = '/' + url
          url = '//' + (netloc or '') + url
--- 129,133 ----
  
  def urlunsplit((scheme, netloc, url, query, fragment)):
!     if netloc or (scheme in uses_netloc and url[:2] != '//'):
          if url and url[:1] != '/': url = '/' + url
          url = '//' + (netloc or '') + url