[ python-Bugs-649961 ] nturl2path.url2pathname() mishandles ///
SourceForge.net
noreply at sourceforge.net
Mon Dec 27 08:12:59 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: Open
Resolution: None
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 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