This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: url2pathname() handling of '/C|/' on Windows
Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.1, Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: orsenthil Nosy List: brian.curtin, calvin, orsenthil, python-dev, santoso.wijaya, tim.golden
Priority: normal Keywords: patch

Created on 2011-03-12 15:30 by calvin, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
nt2urlpath.patch santoso.wijaya, 2011-03-27 21:36 Patch against 2.7 review
Messages (7)
msg130684 - (view) Author: Bastian Kleineidam (calvin) Date: 2011-03-12 15:30
Python 2.7 on Windows converts the URL path '/C|/' to a naked drive letter 'C:'.

C:\src>c:\Python27\python.exe -c "import urllib;print urllib.url2pathname('/C|/')"
C:
C:\src>

Expected and I believe the correct output would be C:\, not C:. Reason is that a naked drive letter C: means "current directory in drive C:", whereas C:\ means "root directory in drive C:". So if you happen to start your application in "C:\src" for example, the output "C:" is interpreted as "C:\src", not as "C:\".
msg130761 - (view) Author: Santoso Wijaya (santoso.wijaya) * Date: 2011-03-13 20:41
I agree. Attaching a patch with a fix and unittest.
msg130776 - (view) Author: Santoso Wijaya (santoso.wijaya) * Date: 2011-03-13 23:04
Oops, wrong library name in patch comment.
msg132366 - (view) Author: Santoso Wijaya (santoso.wijaya) * Date: 2011-03-27 21:36
Fixing patch...
msg133709 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-04-14 04:59
New changeset 4556f17356f2 by Senthil Kumaran in branch '2.7':
Fix Issue11474 - url2pathname() handling of '/C|/' on Windows
http://hg.python.org/cpython/rev/4556f17356f2
msg133713 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-04-14 05:20
New changeset de0da2759c8c by Senthil Kumaran in branch '3.1':
Fix Issue11474 - fix url2pathname() handling of '/C|/' on Windows
http://hg.python.org/cpython/rev/de0da2759c8c
msg133714 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2011-04-14 05:22
Fixed in all the codelines. Thanks for the patch, Santoso.
History
Date User Action Args
2022-04-11 14:57:14adminsetgithub: 55683
2011-04-14 05:22:43orsenthilsetstatus: open -> closed
assignee: orsenthil
resolution: fixed
messages: + msg133714
2011-04-14 05:20:59python-devsetmessages: + msg133713
2011-04-14 04:59:02python-devsetnosy: + python-dev
messages: + msg133709
2011-03-27 21:36:36santoso.wijayasetfiles: + nt2urlpath.patch

messages: + msg132366
2011-03-27 21:36:10santoso.wijayasetfiles: - nturl2path.patch
2011-03-13 23:05:56santoso.wijayasetnosy: calvin, orsenthil, tim.golden, brian.curtin, santoso.wijaya
type: behavior
2011-03-13 23:04:20santoso.wijayasetfiles: + nturl2path.patch
nosy: calvin, orsenthil, tim.golden, brian.curtin, santoso.wijaya
messages: + msg130776
2011-03-13 23:03:45santoso.wijayasetfiles: - nturl2path.patch
nosy: calvin, orsenthil, tim.golden, brian.curtin, santoso.wijaya
2011-03-13 22:32:35pitrousetnosy: + brian.curtin, tim.golden, orsenthil
stage: patch review

versions: + Python 3.1, Python 3.2, Python 3.3
2011-03-13 20:41:14santoso.wijayasetfiles: + nturl2path.patch

nosy: + santoso.wijaya
messages: + msg130761

keywords: + patch
2011-03-12 15:30:22calvincreate