Message146031
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). |
|
Date |
User |
Action |
Args |
2011-10-20 16:54:46 | mandel | set | recipients:
+ mandel |
2011-10-20 16:54:46 | mandel | set | messageid: <1319129686.22.0.325584161741.issue13234@psf.upfronthosting.co.za> |
2011-10-20 16:54:45 | mandel | link | issue13234 messages |
2011-10-20 16:54:45 | mandel | create | |
|