From d4599ff00137ccbbcab5cb0e20d9b0bdbc47588e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 11 Aug 2014 17:53:42 +1000 Subject: Fix T40766: Startup fails with UnicodeDecodeError on Windows --- source/gameengine/Ketsji/KX_PythonInit.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/gameengine') diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index dc603319df4..da8a0c0844e 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -257,7 +257,7 @@ static PyObject *gPyExpandPath(PyObject *, PyObject *args) BLI_strncpy(expanded, filename, FILE_MAX); BLI_path_abs(expanded, gp_GamePythonPath); - return PyUnicode_DecodeFSDefault(expanded); + return PyC_UnicodeFromByte(expanded); } static char gPyStartGame_doc[] = @@ -546,7 +546,7 @@ static PyObject *gPyGetBlendFileList(PyObject *, PyObject *args) while ((dirp = readdir(dp)) != NULL) { if (BLI_testextensie(dirp->d_name, ".blend")) { - value= PyUnicode_DecodeFSDefault(dirp->d_name); + value = PyC_UnicodeFromByte(dirp->d_name); PyList_Append(list, value); Py_DECREF(value); } @@ -1974,7 +1974,7 @@ static void initPySysObjects__append(PyObject *sys_path, const char *filename) BLI_split_dir_part(filename, expanded, sizeof(expanded)); /* 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); /* Don't use BLI_cleanup_dir because it adds a slash - BREAKS WIN32 ONLY */ - item= PyUnicode_DecodeFSDefault(expanded); + item = PyC_UnicodeFromByte(expanded); // printf("SysPath - '%s', '%s', '%s'\n", expanded, filename, gp_GamePythonPath); -- cgit v1.2.3