Skip to content
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

Opt-out of MAX_PATH on Windows 10 #71918

Closed
zooba opened this issue Aug 10, 2016 · 12 comments
Closed

Opt-out of MAX_PATH on Windows 10 #71918

zooba opened this issue Aug 10, 2016 · 12 comments
Assignees
Labels
OS-windows type-feature A feature request or enhancement

Comments

@zooba
Copy link
Member

zooba commented Aug 10, 2016

BPO 27731
Nosy @brettcannon, @pfmoore, @vsajip, @pitrou, @vstinner, @tjguk, @zware, @eryksun, @zooba

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 = <Date 2016-09-07.05:44:31.528>
created_at = <Date 2016-08-10.23:09:48.215>
labels = ['type-feature', 'OS-windows']
title = 'Opt-out of MAX_PATH on Windows 10'
updated_at = <Date 2016-09-07.05:44:31.527>
user = 'https://github.com/zooba'

bugs.python.org fields:

activity = <Date 2016-09-07.05:44:31.527>
actor = 'steve.dower'
assignee = 'steve.dower'
closed = True
closed_date = <Date 2016-09-07.05:44:31.528>
closer = 'steve.dower'
components = ['Windows']
creation = <Date 2016-08-10.23:09:48.215>
creator = 'steve.dower'
dependencies = []
files = []
hgrepos = []
issue_num = 27731
keywords = []
message_count = 12.0
messages = ['272385', '272939', '272960', '273054', '273060', '273061', '273067', '274312', '274313', '274319', '274631', '274743']
nosy_count = 10.0
nosy_names = ['brett.cannon', 'paul.moore', 'vinay.sajip', 'pitrou', 'vstinner', 'tim.golden', 'python-dev', 'zach.ware', 'eryksun', 'steve.dower']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue27731'
versions = ['Python 3.6']

@zooba
Copy link
Member Author

zooba commented 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.

@zooba zooba self-assigned this Aug 10, 2016
@zooba zooba added OS-windows type-feature A feature request or enhancement labels Aug 10, 2016
@vstinner
Copy link
Member

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
Copy link
Member Author

zooba commented Aug 17, 2016

No, the flag that we add to the binary is backwards compatible. Earlier versions will just ignore it.

@pitrou
Copy link
Member

pitrou commented Aug 18, 2016

This is great! Will it apply to third-party C extensions loaded into Python?

@vstinner
Copy link
Member

Steve Dower added the comment:

No, the flag that we add to the binary is backwards compatible. Earlier
versions will just ignore it.

Cool.

@zooba
Copy link
Member Author

zooba commented Aug 18, 2016

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.)

@eryksun
Copy link
Contributor

eryksun commented Aug 18, 2016

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.

@zooba
Copy link
Member Author

zooba commented 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
Copy link
Member Author

zooba commented Sep 3, 2016

@brettcannon
Copy link
Member

SGTM

@zooba
Copy link
Member Author

zooba commented 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
Copy link
Mannequin

python-dev mannequin commented 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-windows type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

5 participants