-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
Opt-out of MAX_PATH on Windows 10 #71918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
According to https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx we can opt-out of MAX_PATH limitations on a selection of functions on the latest version of Windows 10. This will allow unprefixed paths (i.e. no "\\?\") to exceed 260 characters for many common functions. I will enable this for Python 3.6. |
Hum, but we use the same binary (.exe) for all Windows versions. Does it mean that we drop support for Windows < 10 in Python 3.6? |
No, the flag that we add to the binary is backwards compatible. Earlier versions will just ignore it. |
This is great! Will it apply to third-party C extensions loaded into Python? |
Steve Dower added the comment:
Cool. |
Yes, anything running under the python.exe will get it for free. (Non-standard entry points will need to add the flag themselves.) |
py.exe may as well get the manifest setting, but it's not critical. It isn't common to store scripts in deeply nested paths. The same goes for the distlib launchers that pip uses for entry points since they have to open themselves. |
Just discovered that this actually requires enabling the group policy for long paths - specifically setting HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem@LongPathsEnabled to 1. Apparently the manifest is also required, but in my testing the manifest is ignored and we just get long path support for free. So perhaps we should just add a message to file exceptions when the path is >260? |
SGTM |
Just confirmed that the manifest not being required is a bug, so I'll add it, document it and complete this. |
New changeset 26601191b368 by Steve Dower in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: