mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
bpo-37412: pythoninfo: add Windows long paths (GH-14434)
On Windows, test.pythoninfo now checks if support for long paths is enabled using ntdll.RtlAreLongPathsEnabled() function. Co-Authored-By: Eryk Sun <eryksun@gmail.com>
This commit is contained in:
parent
ec3e20a2d1
commit
64580da331
1 changed files with 24 additions and 0 deletions
|
@ -651,6 +651,29 @@ def collect_subprocess(info_add):
|
||||||
copy_attributes(info_add, subprocess, 'subprocess.%s', ('_USE_POSIX_SPAWN',))
|
copy_attributes(info_add, subprocess, 'subprocess.%s', ('_USE_POSIX_SPAWN',))
|
||||||
|
|
||||||
|
|
||||||
|
def collect_windows(info_add):
|
||||||
|
try:
|
||||||
|
import ctypes
|
||||||
|
except ImportError:
|
||||||
|
return
|
||||||
|
|
||||||
|
if not hasattr(ctypes, 'WinDLL'):
|
||||||
|
return
|
||||||
|
|
||||||
|
ntdll = ctypes.WinDLL('ntdll')
|
||||||
|
BOOLEAN = ctypes.c_ubyte
|
||||||
|
|
||||||
|
try:
|
||||||
|
RtlAreLongPathsEnabled = ntdll.RtlAreLongPathsEnabled
|
||||||
|
except AttributeError:
|
||||||
|
res = '<function not available>'
|
||||||
|
else:
|
||||||
|
RtlAreLongPathsEnabled.restype = BOOLEAN
|
||||||
|
RtlAreLongPathsEnabled.argtypes = ()
|
||||||
|
res = bool(RtlAreLongPathsEnabled())
|
||||||
|
info_add('windows.RtlAreLongPathsEnabled', res)
|
||||||
|
|
||||||
|
|
||||||
def collect_info(info):
|
def collect_info(info):
|
||||||
error = False
|
error = False
|
||||||
info_add = info.add
|
info_add = info.add
|
||||||
|
@ -684,6 +707,7 @@ def collect_info(info):
|
||||||
collect_testcapi,
|
collect_testcapi,
|
||||||
collect_time,
|
collect_time,
|
||||||
collect_tkinter,
|
collect_tkinter,
|
||||||
|
collect_windows,
|
||||||
collect_zlib,
|
collect_zlib,
|
||||||
|
|
||||||
# Collecting from tests should be last as they have side effects.
|
# Collecting from tests should be last as they have side effects.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue