[Bf-blender-cvs] [1d4411d1fdd] modifier-panels-ui: Fix T73977, T73825: ignore Python user site-packages directory by default

Brecht Van Lommel noreply at git.blender.org
Thu Apr 16 21:30:29 CEST 2020


Commit: 1d4411d1fdd5244602c8ed0de4481e781a214890
Author: Brecht Van Lommel
Date:   Thu Apr 16 15:54:34 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rB1d4411d1fdd5244602c8ed0de4481e781a214890

Fix T73977, T73825: ignore Python user site-packages directory by default

This goes along with the existing changes to ignore PYTHONPATH by default.
--python-use-system-env now controls both.

Differential Revision: https://developer.blender.org/D6962

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

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

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

diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index b09d3187f3c..6da1715b02d 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -279,9 +279,10 @@ void BPY_python_start(int argc, const char **argv)
    * While harmless, it's noisy. */
   Py_FrozenFlag = 1;
 
-  /* Only use the systems environment variables when explicitly requested.
+  /* Only use the systems environment variables and site when explicitly requested.
    * Since an incorrect 'PYTHONPATH' causes difficult to debug errors, see: T72807. */
   Py_IgnoreEnvironmentFlag = !py_use_system_env;
+  Py_NoUserSiteDirectory = !py_use_system_env;
 
   Py_Initialize();
 
diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c
index 381a43ff521..a13733fd897 100644
--- a/source/creator/creator_args.c
+++ b/source/creator/creator_args.c
@@ -1924,7 +1924,8 @@ static int arg_handle_python_exit_code_set(int argc, const char **argv, void *UN
 
 static const char arg_handle_python_use_system_env_set_doc[] =
     "\n\t"
-    "Allow Python to use system environment variables such as 'PYTHONPATH'.";
+    "Allow Python to use system environment variables such as 'PYTHONPATH' and the user "
+    "site-packages directory.";
 static int arg_handle_python_use_system_env_set(int UNUSED(argc),
                                                 const char **UNUSED(argv),
                                                 void *UNUSED(data))



More information about the Bf-blender-cvs mailing list