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 mandel
Date 2011-10-20.16:54:44
SpamBayes Score 3.5971226e-14
Marked as misclassified No
Message-id <1319129686.22.0.325584161741.issue13234@psf.upfronthosting.co.za>
In-reply-to
Content
During the development of an application that needed to write paths longer than 260 chars we opted to use \\?\ as per http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath.

When working with literal paths the following the os.listdir funtion would return the following trace:

>>> import os
>>> test = r'\\?\C:\Python27'
>>> os.listdir(test)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
WindowsError: [Error 123] The filename, directory name, or volume label syntax is incorrect: '\\\\?\\C:\\Python27/*.*'

The reason for this is that the implementation of listdir appends '/' at the end of the path if os.path.sep is not present at the end of it which FindFirstFile does not like. This is a inconsistency from the OS but it can be easily fixed (see attached patch).
History
Date User Action Args
2011-10-20 16:54:46mandelsetrecipients: + mandel
2011-10-20 16:54:46mandelsetmessageid: <1319129686.22.0.325584161741.issue13234@psf.upfronthosting.co.za>
2011-10-20 16:54:45mandellinkissue13234 messages
2011-10-20 16:54:45mandelcreate