Skip to content

Opt-out of MAX_PATH on Windows 10 #71918

Closed

Description

@zooba
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']

Activity

  1. zooba commented on Aug 10, 2016

    @zooba
    MemberAuthor

    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.

  2. self-assigned this
    on Aug 10, 2016
  3. vstinner commented on Aug 17, 2016

    @vstinner
    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?

  4. zooba commented on Aug 17, 2016

    @zooba
    MemberAuthor

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

  5. pitrou commented on Aug 18, 2016

    @pitrou
    Member

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

  6. vstinner commented on Aug 18, 2016

    @vstinner
    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.

  7. zooba commented on Aug 18, 2016

    @zooba
    MemberAuthor

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

  8. eryksun commented on Aug 18, 2016

    @eryksun
    Contributor

    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.

  9. zooba commented on Sep 3, 2016

    @zooba
    MemberAuthor

    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?

  10. brettcannon commented on Sep 3, 2016

    @brettcannon
    Member

    SGTM

  11. zooba commented on Sep 6, 2016

    @zooba
    MemberAuthor

    Just confirmed that the manifest not being required is a bug, so I'll add it, document it and complete this.

  12. python-dev commented on Sep 7, 2016

    python-devmannequin
    Mannequin

    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

  13. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions