diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-01-06 08:04:07 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-01-06 08:04:07 +0300 |
commit | a0b134cd888ba481cae83328c8c7081dd1a5d18c (patch) | |
tree | f783c67ec564b9feacd6aa411bcf3fdd2860922e /source/gameengine | |
parent | aafd32ab98c05a0bcd1916a2f02713490588e084 (diff) |
bugfix [#25488] Game engine crash when try to run after blender app start
- also found other places where utf8 isnt ensured.
- remove duplicate NULL checks in object_edit.c
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Ketsji/KX_PythonInit.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 48e002fc3c2..f5a9e438e1a 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -232,7 +232,7 @@ static PyObject* gPyExpandPath(PyObject*, PyObject* args) BLI_strncpy(expanded, filename, FILE_MAXDIR + FILE_MAXFILE); BLI_path_abs(expanded, gp_GamePythonPath); - return PyUnicode_FromString(expanded); + return PyUnicode_DecodeFSDefault(expanded); } static char gPyStartGame_doc[] = @@ -498,7 +498,7 @@ static PyObject* gPyGetBlendFileList(PyObject*, PyObject* args) while ((dirp = readdir(dp)) != NULL) { if (BLI_testextensie(dirp->d_name, ".blend")) { - value = PyUnicode_FromString(dirp->d_name); + value= PyUnicode_DecodeFSDefault(dirp->d_name); PyList_Append(list, value); Py_DECREF(value); } @@ -1826,7 +1826,7 @@ static void initPySysObjects__append(PyObject *sys_path, char *filename) BLI_split_dirfile(filename, expanded, NULL); /* get the dir part of filename only */ BLI_path_abs(expanded, gp_GamePythonPath); /* filename from lib->filename is (always?) absolute, so this may not be needed but it wont hurt */ BLI_cleanup_file(gp_GamePythonPath, expanded); /* Dont use BLI_cleanup_dir because it adds a slash - BREAKS WIN32 ONLY */ - item= PyUnicode_FromString(expanded); + item= PyUnicode_DecodeFSDefault(expanded); // printf("SysPath - '%s', '%s', '%s'\n", expanded, filename, gp_GamePythonPath); @@ -1917,7 +1917,7 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur PyObject *py_argv= PyList_New(argc); for (i=0; i<argc; i++) - PyList_SET_ITEM(py_argv, i, PyUnicode_FromString(argv[i])); + PyList_SET_ITEM(py_argv, i, PyC_UnicodeFromByte(argv[i])); PySys_SetObject("argv", py_argv); Py_DECREF(py_argv); |