You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
assignee='https://github.com/zooba'closed_at=<Date2016-09-07.05:44:31.528>created_at=<Date2016-08-10.23:09:48.215>labels= ['type-feature', 'OS-windows']
title='Opt-out of MAX_PATH on Windows 10'updated_at=<Date2016-09-07.05:44:31.527>user='https://github.com/zooba'
anything running under the python.exe will get it for free.
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?
Activity
zooba commentedon Aug 10, 2016
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.
vstinner commentedon Aug 17, 2016
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?
zooba commentedon Aug 17, 2016
No, the flag that we add to the binary is backwards compatible. Earlier versions will just ignore it.
pitrou commentedon Aug 18, 2016
This is great! Will it apply to third-party C extensions loaded into Python?
vstinner commentedon Aug 18, 2016
Steve Dower added the comment:
Cool.
zooba commentedon Aug 18, 2016
Yes, anything running under the python.exe will get it for free.
(Non-standard entry points will need to add the flag themselves.)
eryksun commentedon Aug 18, 2016
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.
zooba commentedon Sep 3, 2016
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?
zooba commentedon Sep 3, 2016
More info at https://blogs.msdn.microsoft.com/jeremykuhne/2016/07/30/net-4-6-2-and-long-paths-on-windows-10/
brettcannon commentedon Sep 3, 2016
SGTM
zooba commentedon Sep 6, 2016
Just confirmed that the manifest not being required is a bug, so I'll add it, document it and complete this.
python-dev commentedon Sep 7, 2016
New changeset 26601191b368 by Steve Dower in branch 'default':
Issue bpo-27731: Opt-out of MAX_PATH on Windows 10
https://hg.python.org/cpython/rev/26601191b368