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.

classification
Title: python.exe crashed when open long path in windows 7
Type: crash Stage: resolved
Components: Windows Versions: Python 2.7
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: aokaywe, eryksun, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2017-05-28 00:54 by aokaywe, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
python.png aokaywe, 2017-05-28 00:54
Messages (2)
msg294618 - (view) Author: aokaywe (aokaywe) Date: 2017-05-28 00:54
1. os.makedirs(ur'\\?\c:\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹')
2. open(ur'\\?\c:\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\测试文件夹\t.txt','w')

you can see python was crashed.
msg294621 - (view) Author: Eryk Sun (eryksun) * (Python triager) Date: 2017-05-28 01:41
Your example works fine for me in Windows 10, and I see no reason why it would fail in Windows 7. The crash dialog in your screenshot shows that the problem occurred in a DLL named "winhadnt.dll". I suspect that this is malware injected into the python.exe process. Even if it's part of a legitimately installed program on your machine, this DLL has nothing to do with Python, so I'm closing this issue as 3rd party. 

By the way, Python 2 doesn't completely support raw unicode strings. '\u' and '\U' are still parsed as Unicode escape sequences. You can use forward slash for the path literal instead. Then normalize the path to use backslash at runtime.
History
Date User Action Args
2022-04-11 14:58:47adminsetgithub: 74679
2017-05-28 01:41:13eryksunsetstatus: open -> closed

type: crash

nosy: + eryksun
messages: + msg294621
resolution: third party
stage: resolved
2017-05-28 00:54:59aokaywecreate