Issue 27731: Opt-out of MAX_PATH on Windows 10 (original) (raw)

Created on 2016-08-10 23:09 by steve.dower, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (12)
msg272385 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2016-08-10 23:09
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.
msg272939 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-08-17 13:27
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?
msg272960 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2016-08-17 15:34
No, the flag that we add to the binary is backwards compatible. Earlier versions will just ignore it.
msg273054 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2016-08-18 18:31
This is great! Will it apply to third-party C extensions loaded into Python?
msg273060 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-08-18 19:10
Steve Dower added the comment: > No, the flag that we add to the binary is backwards compatible. Earlier versions will just ignore it. Cool.
msg273061 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2016-08-18 19:16
> Will it apply to third-party C extensions loaded into Python? Yes, anything running under the python.exe will get it for free. (Non-standard entry points will need to add the flag themselves.)
msg273067 - (view) Author: Eryk Sun (eryksun) * (Python triager) Date: 2016-08-18 22:43
> 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.
msg274312 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2016-09-03 17:00
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?
msg274313 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2016-09-03 17:01
More info at https://blogs.msdn.microsoft.com/jeremykuhne/2016/07/30/net-4-6-2-and-long-paths-on-windows-10/
msg274319 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2016-09-03 18:20
SGTM
msg274631 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2016-09-06 21:13
Just confirmed that the manifest not being required is a bug, so I'll add it, document it and complete this.
msg274743 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-07 03:40
New changeset 26601191b368 by Steve Dower in branch 'default': Issue #27731: Opt-out of MAX_PATH on Windows 10 https://hg.python.org/cpython/rev/26601191b368
History
Date User Action Args
2022-04-11 14:58:34 admin set github: 71918
2016-09-07 05:44:31 steve.dower set status: open -> closedresolution: fixedstage: needs patch -> resolved
2016-09-07 03:40:28 python-dev set nosy: + python-devmessages: +
2016-09-06 21:13:51 steve.dower set messages: +
2016-09-03 18:20:47 brett.cannon set messages: +
2016-09-03 17:01:31 steve.dower set messages: +
2016-09-03 17:00:59 steve.dower set messages: +
2016-08-18 22:43:48 eryksun set nosy: + eryksun, vinay.sajipmessages: +
2016-08-18 19:16:16 steve.dower set messages: +
2016-08-18 19:10:31 vstinner set messages: +
2016-08-18 18:31:28 pitrou set nosy: + pitroumessages: +
2016-08-17 15:34:31 steve.dower set messages: +
2016-08-17 13:27:31 vstinner set nosy: + vstinnermessages: +
2016-08-10 23:31:42 brett.cannon set nosy: + brett.cannon
2016-08-10 23:09:48 steve.dower create