mirror of
https://github.com/python/cpython
synced 2026-09-29 11:35:29 +03:00
Issue #27731: Opt-out of MAX_PATH on Windows 10
This commit is contained in:
parent
437df90537
commit
19ab0fd456
4 changed files with 37 additions and 2 deletions
|
|
@ -74,6 +74,31 @@ installation". In this case:
|
|||
* If selected, the install directory will be added to the system :envvar:`PATH`
|
||||
* Shortcuts are available for all users
|
||||
|
||||
.. _max-path:
|
||||
|
||||
Removing the MAX_PATH Limitation
|
||||
--------------------------------
|
||||
|
||||
Windows historically has limited path lengths to 260 characters. This meant that
|
||||
paths longer than this would not resolve and errors would result.
|
||||
|
||||
In the latest versions of Windows, this limitation can be expanded to
|
||||
approximately 32,000 characters. Your administrator will need to activate the
|
||||
"Enable Win32 long paths" group policy, or set the registry value
|
||||
``HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem@LongPathsEnabled``
|
||||
to ``1``.
|
||||
|
||||
This allows the :func:`open` function, the :mod:`os` module and most other
|
||||
path functionality to accept and return paths longer than 260 characters when
|
||||
using strings. (Use of bytes as paths is deprecated on Windows, and this feature
|
||||
is not available when using bytes.)
|
||||
|
||||
After changing the above option, no further configuration is required.
|
||||
|
||||
.. versionchanged:: 3.6
|
||||
|
||||
Support for long paths was enabled in Python.
|
||||
|
||||
.. _install-quiet-option:
|
||||
|
||||
Installing Without UI
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue