|
128 | 128 | # checked by looking for the BUILDDIR_TXT file, which contains the |
129 | 129 | # relative path to the platlib dir. The executable_dir value is |
130 | 130 | # derived from joining the VPATH preprocessor variable to the |
131 | | -# directory containing pybuilddir.txt. If it is not found, the |
132 | | -# BUILD_LANDMARK file is found, which is part of the source tree. |
| 131 | +# directory containing pybuilddir.txt. |
133 | 132 | # prefix is then found by searching up for a file that should only |
134 | 133 | # exist in the source tree, and the stdlib dir is set to prefix/Lib. |
135 | 134 |
|
|
175 | 174 |
|
176 | 175 | if os_name == 'posix' or os_name == 'darwin': |
177 | 176 | BUILDDIR_TXT = 'pybuilddir.txt' |
178 | | - BUILD_LANDMARK = 'Modules/Setup.local' |
179 | 177 | DEFAULT_PROGRAM_NAME = f'python{VERSION_MAJOR}' |
180 | 178 | STDLIB_SUBDIR = f'{platlibdir}/python{VERSION_MAJOR}.{VERSION_MINOR}' |
181 | 179 | STDLIB_LANDMARKS = [f'{STDLIB_SUBDIR}/os.py', f'{STDLIB_SUBDIR}/os.pyc'] |
|
188 | 186 |
|
189 | 187 | elif os_name == 'nt': |
190 | 188 | BUILDDIR_TXT = 'pybuilddir.txt' |
191 | | - BUILD_LANDMARK = f'{VPATH}\\Modules\\Setup.local' |
192 | 189 | DEFAULT_PROGRAM_NAME = f'python' |
193 | 190 | STDLIB_SUBDIR = 'Lib' |
194 | 191 | STDLIB_LANDMARKS = [f'{STDLIB_SUBDIR}\\os.py', f'{STDLIB_SUBDIR}\\os.pyc'] |
@@ -495,13 +492,9 @@ def search_up(prefix, *landmarks, test=isfile): |
495 | 492 | platstdlib_dir = real_executable_dir |
496 | 493 | build_prefix = joinpath(real_executable_dir, VPATH) |
497 | 494 | except (FileNotFoundError, PermissionError): |
498 | | - if isfile(joinpath(real_executable_dir, BUILD_LANDMARK)): |
499 | | - build_prefix = joinpath(real_executable_dir, VPATH) |
500 | | - if os_name == 'nt': |
501 | | - # QUIRK: Windows builds need platstdlib_dir to be the executable |
502 | | - # dir. Normally the builddir marker handles this, but in this |
503 | | - # case we need to correct manually. |
504 | | - platstdlib_dir = real_executable_dir |
| 495 | + # We used to check for an alternate landmark here, but now we require |
| 496 | + # BUILDDIR_TXT to exist. (gh-151544; CVE-2026-12003) |
| 497 | + pass |
505 | 498 |
|
506 | 499 | if build_prefix: |
507 | 500 | if os_name == 'nt': |
|
0 commit comments