File pythonpath-2.48.patch of Package blender

Index: source/blender/python/BPY_interface.c
===================================================================
--- source/blender/python/BPY_interface.c.orig
+++ source/blender/python/BPY_interface.c
@@ -225,6 +225,12 @@ void BPY_start_python( int argc, char **
 	Py_Initialize(  );
 	
 	PySys_SetArgv( argc_copy, argv_copy );
+	
+	/* Sanitize sys.path to prevent relative imports loading modules in
+	 * the current working directory
+	 */
+	PyRun_SimpleString("import sys; sys.path = filter(None, sys.path)");
+	
 	/* Initialize thread support (also acquires lock) */
 	PyEval_InitThreads();
 	
openSUSE Build Service is sponsored by