[Bf-blender-cvs] [ebb492a389d] master: Python: log the status of '--python-use-system-env' on initialization

Campbell Barton noreply at git.blender.org
Wed May 18 03:38:21 CEST 2022


Commit: ebb492a389d42186b254c56f3cd3a42b72c5f57b
Author: Campbell Barton
Date:   Wed May 18 11:31:04 2022 +1000
Branches: master
https://developer.blender.org/rBebb492a389d42186b254c56f3cd3a42b72c5f57b

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).

===================================================================

M	source/blender/python/intern/bpy_interface.c

===================================================================

diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index baad2e6a2c2..5c9de638d8a 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -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);
     }



More information about the Bf-blender-cvs mailing list