Author Anthony Sottile
Recipients Anthony Sottile, paul.moore, steve.dower, tim.golden, zach.ware
Date 2018-01-12.16:56:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1515776205.66.0.467229070634.issue32539@psf.upfronthosting.co.za>
In-reply-to
Content
On windows, a deep path can be accessed by prefixing the path with \\?\

https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx?f=255&MSPPError=-2147217396#maxpath

The call to `listdir()` fails because it uses a posix separator.

A quick patch to fix this is to use `SEP` here: https://github.com/python/cpython/blob/ab95b3074ee43098edf3f23b07fb18ef57ee614d/Modules/posixmodule.c#L2388 (I can submit a patch for this)

Here's a stacktrace

>>> os.listdir(r'\\?\C:\Temp')
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:\\Temp/*.*'


This works fine in python3, as the code has been refactored to use `SEP` already.

>>> os.listdir(r'\\?\C:\Temp')
[]
History
Date User Action Args
2018-01-12 16:56:45Anthony Sottilesetrecipients: + Anthony Sottile, paul.moore, tim.golden, zach.ware, steve.dower
2018-01-12 16:56:45Anthony Sottilesetmessageid: <1515776205.66.0.467229070634.issue32539@psf.upfronthosting.co.za>
2018-01-12 16:56:45Anthony Sottilelinkissue32539 messages
2018-01-12 16:56:45Anthony Sottilecreate