diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-08-11 11:53:42 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-08-11 11:53:42 +0400 |
commit | d4599ff00137ccbbcab5cb0e20d9b0bdbc47588e (patch) | |
tree | 95558d772308170d599f8cf96e761dcf42550408 /source/blender | |
parent | 1528e5c20a3aa87302b0df123070927178877713 (diff) |
Fix T40766: Startup fails with UnicodeDecodeError on Windows
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/python/intern/bpy.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index 5fd19d3ed88..134e718bce5 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -51,12 +51,15 @@ #include "bpy_operator.h" #include "bpy_utils_units.h" +#include "../generic/py_capi_utils.h" + #include "MEM_guardedalloc.h" /* external util modules */ #include "../generic/idprop_py_api.h" #include "../generic/bgl.h" #include "../generic/blf_py_api.h" +#include "../generic/blf_py_api.h" #include "../mathutils/mathutils.h" #ifdef WITH_FREESTYLE @@ -80,11 +83,11 @@ static PyObject *bpy_script_paths(PyObject *UNUSED(self)) const char *path; path = BLI_get_folder(BLENDER_SYSTEM_SCRIPTS, NULL); - item = PyUnicode_DecodeFSDefault(path ? path : ""); + item = PyC_UnicodeFromByte(path ? path : ""); BLI_assert(item != NULL); PyTuple_SET_ITEM(ret, 0, item); path = BLI_get_folder(BLENDER_USER_SCRIPTS, NULL); - item = PyUnicode_DecodeFSDefault(path ? path : ""); + item = PyC_UnicodeFromByte(path ? path : ""); BLI_assert(item != NULL); PyTuple_SET_ITEM(ret, 1, item); @@ -94,7 +97,7 @@ static PyObject *bpy_script_paths(PyObject *UNUSED(self)) static bool bpy_blend_paths_visit_cb(void *userdata, char *UNUSED(path_dst), const char *path_src) { PyObject *list = (PyObject *)userdata; - PyObject *item = PyUnicode_DecodeFSDefault(path_src); + PyObject *item = PyC_UnicodeFromByte(path_src); PyList_Append(list, item); Py_DECREF(item); return false; /* never edits the path */ @@ -171,7 +174,7 @@ static PyObject *bpy_user_resource(PyObject *UNUSED(self), PyObject *args, PyObj if (!path) path = BLI_get_user_folder_notest(folder_id, subdir); - return PyUnicode_DecodeFSDefault(path ? path : ""); + return PyC_UnicodeFromByte(path ? path : ""); } PyDoc_STRVAR(bpy_resource_path_doc, @@ -210,7 +213,7 @@ static PyObject *bpy_resource_path(PyObject *UNUSED(self), PyObject *args, PyObj path = BLI_get_folder_version(folder_id, (major * 100) + minor, false); - return PyUnicode_DecodeFSDefault(path ? path : ""); + return PyC_UnicodeFromByte(path ? path : ""); } PyDoc_STRVAR(bpy_escape_identifier_doc, |