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.

Author steve.dower
Recipients Aaron.Meurer, Voo, eryksun, ezio.melotti, jens, loewis, pitrou, santoso.wijaya, serhiy.storchaka, steve.dower, vstinner, zach.ware
Date 2016-02-11.18:48:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1455216537.57.0.0253650974626.issue18199@psf.upfronthosting.co.za>
In-reply-to
Content
Paths prefixed with "\\?\" also need to be normalized, not just absolute. AFAIK there are no official docs on what normalization is required, but it includes at least trimming trailing dots on directory names, removing "." and ".." sections, adjacent backslashes, and removing trailing spaces on any segment.

Without this, you will access/create/etc. files that users cannot otherwise see or modify.

I don't disagree that we should add the prefix for long paths, but we need to at least get most of the normalization correct so that cases like this work:

>>> open('C:\\Dir \\file.txt.', 'r').read()
"Content"
>>> open('\\\\?\\C:\\Dir \\file.txt.', 'r').read()
FileNotFoundError: [Errno 2] No such file or directory: '\\\\?\\C:\\Dir \\file.txt.'
History
Date User Action Args
2016-02-11 18:48:57steve.dowersetrecipients: + steve.dower, loewis, pitrou, vstinner, ezio.melotti, Aaron.Meurer, santoso.wijaya, Voo, jens, zach.ware, serhiy.storchaka, eryksun
2016-02-11 18:48:57steve.dowersetmessageid: <1455216537.57.0.0253650974626.issue18199@psf.upfronthosting.co.za>
2016-02-11 18:48:57steve.dowerlinkissue18199 messages
2016-02-11 18:48:57steve.dowercreate