python.exe崩溃时,在打开的窗口长路7
的Python崩溃时我做以下步骤:python.exe崩溃时,在打开的窗口长路7
os.makedirs(ur'\\?\c:\测试文件夹')
open(ur'\\?\c:\测试文件夹\t.txt','w')
你可以看到完整的路径在这里: http://psf.upfronthosting.co.za/roundup/meta/issue629%3E
Windows有一个包含256个字符的路径长度限制(包括盘符后的所有内容);这个问题似乎是你的路径超过了这个限制。如果您尝试通过Windows资源管理器手动创建该路径,我想您会发现该路径无法在该处创建。
从MSDN文档(link):
In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters. A local path is structured in the following order: drive letter, colon, backslash, name components separated by backslashes, and a terminating null character. For example, the maximum path on drive D is "D:\some 256-character path string" where "" represents the invisible terminating null character for the current system codepage. (The characters < > are used here for visual clarity and cannot be part of a valid path string.)
也许这是一个权限问题? –
我自己并不是Windows用户,但不会Windows报告WindowsError:[错误5]访问被拒绝或类似的权限问题? – errata
请访问链接,这是一个漫长的路径问题 – aokaywe