[issue9575] os.listdir() crashes on some long and deep paths in Windows 7

Heejin report at bugs.python.org
Thu Aug 12 15:57:34 CEST 2010


Heejin <aheejin at gmail.com> added the comment:

Thank you for your answer.

Actually I tried that in two Windows7-installed computers
and failed in both. But I don't think it is the problem of
path lengths; I created other paths that long and that deep
but os.listdir() works on them. That's why I wrote the path
verbatim on which the function crashes.
I couldn't find the exact conditions for it to crash.

I haven't heard of that "filesystem namespace prefix"
'\\\\?\\' before. I searched it in the manual and googled it
but couldn't find an explanation about it. But when I modified
the path in my example temp.py it worked! I don't know why though.
Could you point out some informative pages about this prefix?

Unfortunately, the example temp.py is characterizing only the
key reason of the crash. My program uses os.walk() and
os.listdir() was actually called within os.walk(),
so I cannot prepend the path with '\\\\?\\'.

Fortunately I found another workaround for my program,
but this still seems a bug..

Thank you.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9575>
_______________________________________


More information about the Python-bugs-list mailing list