https://github.com/python/cpython/commit/46c5c57226862bc078bcdf0c9f5b40951b8615a5
commit: 46c5c57226862bc078bcdf0c9f5b40951b8615a5
branch: main
author: Filipe Laíns <[email protected]>
committer: FFY00 <[email protected]>
date: 2026-03-02T21:11:27Z
summary:

GH-145273: skip stdlib warning on module_search_paths_set (#145442)

files:
M Modules/getpath.py

diff --git a/Modules/getpath.py b/Modules/getpath.py
index 20e050787700bf..2f4d635a29585c 100644
--- a/Modules/getpath.py
+++ b/Modules/getpath.py
@@ -773,8 +773,10 @@ def search_up(prefix, *landmarks, test=isfile):
 # SANITY CHECKS
 # 
******************************************************************************
 
-# Warn if the standard library is missing
-if not stdlib_zip or not isfile(stdlib_zip):
+# Warn if the standard library is missing, unless pythonpath_was_set was set, 
as
+# that skips parts of the stdlib directories calculation — assume the provided
+# pythonpath is correct. This is how subinterpreters initialize the path for 
eg.
+if not py_setpath and not pythonpath_was_set and (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(stdlib_dir):
         hint = home_hint if home else f'sys.prefix is set to {prefix}, is this 
correct?'

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to