[issue9575] os.listdir() crashes on some long and deep paths in Windows 7
Heejin ahee...@gmail.com added the comment: Thank you for your answer. I cannot provide any error messages or stack traces because it really *crashed*. python.exe suddenly stops working and a windows pops up saying something like python.exe had a problem and needed to be closed I cannot say what the pop-up message exactly was because I'm using Korean version windows and the message was Korean. There were no python error messages or stack traces. And the file temp.py I attached first was the file exactly reproducing the situation, at least in my computer. And I think it's perhaps a Korean windows problem or related to some other programs in my computer. I also tried to narrow down the cause but I couldn't find any rules. Maybe it is better to open a thread again when I get to find some exact conditions on which the problem appears. Thank you. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9575 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9575] os.listdir() crashes on some long and deep paths in Windows 7
Tim Golden m...@timgolden.me.uk added the comment: Thanks for the feedback. I'll close this for now as works for me. Feel free to reopen if you can come up with anything fresh. -- resolution: - works for me stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9575 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9575] os.listdir() crashes on some long and deep paths in Windows 7
New submission from Heejin ahee...@gmail.com: As far as I have seen, this bug only appears in Windows 7. I tested with Python 2.5, 2.6, and 2.7 and they all seem to have this bug. I tested with Windows 7 Korean version. I'm not sure if other language versions have the same problem. Reproduction steps: 1. Run a command shell 'cmd'. 2. Run following commands in order: cd c:\ mkdir rpcc\build cd rpcc\build mkdir customs\llvm2dre\llvm-2.6\tools\clang\test\CXX\over\over.match\over.match.best\over.best.ics\over.ics.ellipsis\.svn\tmp\prop-base 3. Create a python script file temp.py with the contents below import os path = 'customs\\llvm2dre\\llvm-2.6\\tools\\clang\\test\\CXX\\over\\over.match\\over.match.best\\over.best.ics\\over.ics.ellipsis\\.svn\\tmp\\prop-base' os.listdir(path) (I attached this file in this post) 4. Run the script. python temp.py 5. Then you can see it crashes. -- components: Library (Lib), Windows files: temp.py messages: 113672 nosy: aheejin priority: normal severity: normal status: open title: os.listdir() crashes on some long and deep paths in Windows 7 type: crash versions: Python 2.5, Python 2.6, Python 2.7 Added file: http://bugs.python.org/file18483/temp.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9575 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9575] os.listdir() crashes on some long and deep paths in Windows 7
Changes by Tim Golden m...@timgolden.me.uk: -- assignee: - tim.golden nosy: +tim.golden versions: -Python 2.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9575 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9575] os.listdir() crashes on some long and deep paths in Windows 7
Tim Golden m...@timgolden.me.uk added the comment: I can't get it crash on a path that short. I can produce an error message if I push it beyond the 254 limit, but you can work around that by applying the filesystem namespace prefix: code import os path = c:\\ + \\.join (130 * ['xx']) os.makedirs (path) # # will fail more or less violently # path = ?\\ + path os.makedirs (path) os.listdir (path) /code Probably related issues: http://bugs.python.org/issue9246 http://bugs.python.org/issue4071 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9575 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9575] os.listdir() crashes on some long and deep paths in Windows 7
Heejin ahee...@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 rep...@bugs.python.org http://bugs.python.org/issue9575 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9575] os.listdir() crashes on some long and deep paths in Windows 7
Tim Golden m...@timgolden.me.uk added the comment: See: http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx I tried first with your exact path and it caused no issues on my Win7 box. FWIW you could easily roll your own os.walk (starting by copying the code that's there) if you needed to roll in special-cases. Could you provide a batch file / Python script which exactly reproduces the issue and a cut-and-paste of the resulting traceback. (Unless crash really does mean crash). Would you be able to narrow the issue down any further: see if any other paths cause the same issue, or if a longer or a shorter version of the path is problematic. TJG -- title: os.listdir() crashes on some long and deep paths in Windows 7 - os.listdir() crashes on some long and deep paths in Windows 7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9575 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com