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 mandel
Recipients brian.curtin, mandel, pitrou, tim.golden
Date 2012-07-08.09:58:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1341741537.6.0.462204428683.issue15286@psf.upfronthosting.co.za>
In-reply-to
Content
Antoine,

What the MSDN is stating is that the Windows functions from COM will not normalize the path if it is prefixed by \\?\. That is, if a user wanted to do:

path = r'\\?\C:\Users\mandel\..\Desktop\test'
with open(path, 'w') as fd:
    fd.write('hello!')

he will get the following:

[Errorno 22] Invalid argument. r'\\?\C:\Users\mandel\..\Desktop\test'

The same think would happen if a C function is used, that is, open is doing the right thing. On the other hand, the same code without the \\?\ works.

This makes it even more important to allow the normpath users to normalize such paths, that is, a developer knows that the path has more than 260 chars and wants to make sure that the path can be written in the system:

May I ask you why you mention the symbolic links? I know that if one of the segments of the path is a symbolic link there are problems but this is not related to \\?\ or am I confused? Just curious :)

Brian,

The ntpath module is a little mess (look at my other patch http://bugs.python.org/issue15275) and I think there are more performance problems hidden there somewhere...

I imported string within the function because the same is done in expandvars (around line 430) and wanted to follow the style that was already in use in the file. I do agree that imports at the top are the way to go :)
History
Date User Action Args
2012-07-08 09:58:57mandelsetrecipients: + mandel, pitrou, tim.golden, brian.curtin
2012-07-08 09:58:57mandelsetmessageid: <1341741537.6.0.462204428683.issue15286@psf.upfronthosting.co.za>
2012-07-08 09:58:57mandellinkissue15286 messages
2012-07-08 09:58:55mandelcreate