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 <>
During the development of an application that needed to write paths longer than 260 chars we opted to use \\?\ as per

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).
Date User Action Args
2011-10-20 16:54:46mandelsetrecipients: + mandel
2011-10-20 16:54:46mandelsetmessageid: <>
2011-10-20 16:54:45mandellinkissue13234 messages
2011-10-20 16:54:45mandelcreate