[issue27729] Provide a better error message when the file path is too long on Windows

2020-06-12 Thread Eryk Sun
Eryk Sun added the comment: Thanks for working on a PR, Zackery. Note that we can't rely on GetLastError() in PyErr_SetFromErrnoWithFilenameObjects. It may be called in contexts where the thread's LastErrorValue is no longer related to the C errno value. My suggestion in msg272427 was inten

[issue27729] Provide a better error message when the file path is too long on Windows

2020-06-12 Thread Zackery Spytz
Change by Zackery Spytz : -- keywords: +patch nosy: +ZackerySpytz nosy_count: 6.0 -> 7.0 pull_requests: +20037 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/20844 ___ Python tracker

[issue27729] Provide a better error message when the file path is too long on Windows

2016-08-11 Thread Eryk Sun
Eryk Sun added the comment: The NT runtime API RtlDosPathNameToRelativeNtPathName_U_WithStatus returns an informative error code, STATUS_NAME_TOO_LONG (0xC106). This gets translated to the less information but still useful Windows code ERROR_PATH_NOT_FOUND (0x0003). The CRT error table red

[issue27729] Provide a better error message when the file path is too long on Windows

2016-08-10 Thread Steve Dower
Steve Dower added the comment: See https://github.com/pypa/pip/issues/3055 for an example of this error. (Also note that there is a path limit of ~32k with the prefix, and that using it also disables a lot of standard path resolution algorithms, so simply adding it everywhere does not fix anyt

[issue27729] Provide a better error message when the file path is too long on Windows

2016-08-10 Thread Brett Cannon
New submission from Brett Cannon: Windows has a max path length when the path doesn't start with r'\\?\'. When you hit that limit you get a FileNotFoundError but no explanation that it was because of some file path length. It would be nice to clarify this case in the exception message (probabl