[Patches] [ python-Patches-591713 ] Fix "file:" URL to have right no. of /'s

noreply@sourceforge.net noreply@sourceforge.net
Tue, 17 Sep 2002 14:22:25 -0700


Patches item #591713, was opened at 2002-08-06 15:26
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=591713&group_id=5470

Category: Library (Lib)
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Bruce Atherton (callenish)
>Assigned to: Fred L. Drake, Jr. (fdrake)
>Summary: Fix "file:" URL to have right no. of /'s

Initial Comment:
If you run urlparse.urljoin() on a file: URL, the resulting URL 
has together with the wrong number of '/'s in it.

Properly formed, the URL (assuming no netloc) should have 
three slashes, so that it looks like "file:///...". The current 
code drops that down to one.

The error appears to be in a condition in urlunsplit(). It 
doesn't show up except in this one instance because the 
test is only run iff the scheme is in the list of those that can 
take a netloc and there is no netloc present in the URL. 
Apparently, this is pretty rare.

Patch attached that corrects the condition.


----------------------------------------------------------------------

>Comment By: Neal Norwitz (nnorwitz)
Date: 2002-09-17 17:22

Message:
Logged In: YES 
user_id=33168

Not sure who is best to review this?  Fred?  Jeremy? 
Someone else?

This patch works for me.  I have a test too.  Assign back to
me if you want me to check it in.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=591713&group_id=5470