[ python-Bugs-649961 ] nturl2path.url2pathname() mishandles ///

SourceForge.net noreply at sourceforge.net
Tue Dec 28 06:25:10 CET 2004


Bugs item #649961, was opened at 2002-12-07 01:19
Message generated for change (Comment added) made by mike_j_brown
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=649961&group_id=5470

Category: Windows
Group: Python 2.2.1
>Status: Closed
>Resolution: Wont Fix
Priority: 5
Submitted By: Mike Brown (mike_j_brown)
Assigned to: Nobody/Anonymous (nobody)
Summary: nturl2path.url2pathname() mishandles ///

Initial Comment:
On Windows, urllib.url2pathname('///path/to/file') returns 
r'\\path\to\file'. This path cannot be used in things like 
open() and os.access(). It should probably return 
r'\path\to\file'.

In addition, '//localhost/path/to/file' is a special case that 
should become '\path\to\file'.  I'll post this as a separate 
bug since it affects all file URIs.

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

>Comment By: Mike Brown (mike_j_brown)
Date: 2004-12-27 22:25

Message:
Logged In: YES 
user_id=371366

Ah, gotcha. I am closing this as "Wont Fix", myself. I have
modified the description of #649974 to make it be a
Documentation enhancement for 2.4. My proposed patches in
that report will satisfy my concerns without going into
unnecessary detail.

Thanks! -Mike

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

Comment By: Facundo Batista (facundobatista)
Date: 2004-12-27 17:32

Message:
Logged In: YES 
user_id=752496

The documentation for urllib states that:

Although the urllib module contains (undocumented) routines
to parse and unparse URL strings, the recommended interface
for URL manipulation is in module urlparse.

So, if you think that the files should also be modified,
change the group of this bug to 2.4. Otherwise it will be
closed as won't fix.

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

Comment By: Facundo Batista (facundobatista)
Date: 2004-12-27 17:32

Message:
Logged In: YES 
user_id=752496

Please, could you verify if this problem persists in Python 2.3.4
or 2.4?

If yes, in which version? Can you provide a test case?

If the problem is solved, from which version?

Note that if you fail to answer in one month, I'll close this bug
as "Won't fix".

Thank you! 

.    Facundo

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

Comment By: Mike Brown (mike_j_brown)
Date: 2004-12-27 00:12

Message:
Logged In: YES 
user_id=371366

See #649974 -- url2pathname() and pathname2url() are
undocumented, platform-specific, and not really
general-purpose. It probably should not be assumed that they
are intended to produce values that are usable with open(),
os.access(), or anything other than where they are currently
used internally in urllib.

The solution as proposed for #649974 is probably just to
document the functions and discourage their general use. See
the suggested diffs attached to that report.

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

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


More information about the Python-bugs-list mailing list