Python: log the status of '--python-use-system-env' on initialization

Report when the PYTHONPATH is expected to be used to help debug Python
initialization issues (see T98131).
This commit is contained in:
Campbell Barton 2022-05-18 11:31:04 +10:00
parent df26f4f63a
commit ebb492a389
Notes: blender-bot 2023-12-01 14:46:23 +01:00
Referenced by issue #98131, Newly installed Blender won't open in windows 10 due to python error
Referenced by issue #115648, New Windows install, multiple Blender versions crash:  EXCEPTION_ACCESS_VIOLATION  (Python 3.12.0 conflict?)
1 changed files with 8 additions and 0 deletions

View File

@ -312,6 +312,14 @@ void BPY_python_start(bContext *C, int argc, const char **argv)
PyPreConfig preconfig;
PyStatus status;
/* To narrow down reports where the systems Python is inexplicably used, see: T98131. */
CLOG_INFO(
BPY_LOG_INTERFACE,
2,
"Initializing %s support for the systems Python environment such as 'PYTHONPATH' and "
"the user-site directory.",
py_use_system_env ? "*with*" : "*without*");
if (py_use_system_env) {
PyPreConfig_InitPythonConfig(&preconfig);
}