Skip to content
Merged
Prev Previous commit
Next Next commit
Revert "Resolve symlinks before file check (needed for Windows)"
This reverts commit 3a67467.

Signed-off-by: Filipe Laíns <lains@riseup.net>
  • Loading branch information
FFY00 committed Feb 27, 2026
commit aa6014ac56fd5906983d599864e3b9134cfc6a2e
6 changes: 3 additions & 3 deletions Modules/getpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,12 +774,12 @@ def search_up(prefix, *landmarks, test=isfile):
# ******************************************************************************

# Warn if the standard library is missing
if not stdlib_zip or not isfile(realpath(stdlib_zip)):
if not stdlib_zip or not isfile(stdlib_zip):
home_hint = f"The Python 'home' directory was set to {home!r}, is this correct?"
if not stdlib_dir or not isdir(realpath(stdlib_dir)):
if not stdlib_dir or not isdir(stdlib_dir):
hint = home_hint if home else f'sys.prefix is set to {prefix}, is this correct?'
warn('WARN: Could not find the standard library directory! ' + hint)
elif (not platstdlib_dir and not build_prefix) or not isdir(realpath(platstdlib_dir)):
elif (not platstdlib_dir and not build_prefix) or not isdir(platstdlib_dir):

@FFY00 FFY00 Feb 26, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed the tests, but unless we skip the platstdlib_dir check when running from source, the warning will show up on make, during the pybuilddir.txt generation.

I would prefer to drop the build_prefix check, and instead add -X pathconfig_warnings=0 to the -m sysconfig --generate-posix-vars call in the makefile.

Suggested change
elif (not platstdlib_dir and not build_prefix) or not isdir(platstdlib_dir):
elif not platstdlib_dir or not isdir(platstdlib_dir):

hint = home_hint if home else f'sys.exec_prefix is set to {exec_prefix}, is this correct?'
warn('WARN: Could not find the platform standard library directory! ' + hint)

Expand Down
Loading