diff options
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/intern/bpy_interface.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 894a9a69198..e8d309b8a50 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -349,17 +349,16 @@ void BPY_python_start(bContext *C, int argc, const char **argv) /* Initialize Python (also acquires lock). */ Py_Initialize(); - // PySys_SetArgv(argc, argv); /* broken in py3, not a huge deal */ - /* sigh, why do python guys not have a (char **) version anymore? */ + /* We could convert to #wchar_t then pass to #PySys_SetArgv (or use #PyConfig in Python 3.8+). + * However this risks introducing subtle changes in encoding that are hard to track down. + * + * So rely on #PyC_UnicodeFromByte since it's a tried & true way of getting paths + * that include non `utf-8` compatible characters, see: T20021. */ { - int i; PyObject *py_argv = PyList_New(argc); - for (i = 0; i < argc; i++) { - /* should fix bug T20021 - utf path name problems, by replacing - * PyUnicode_FromString, with this one */ + for (int i = 0; i < argc; i++) { PyList_SET_ITEM(py_argv, i, PyC_UnicodeFromByte(argv[i])); } - PySys_SetObject("argv", py_argv); Py_DECREF(py_argv); } |