Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-04-30 17:43:01 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-04-30 17:43:01 +0400
commit4d1a109ddec02ad7e527d8b65a5cdc8d4a7528a9 (patch)
tree3bc4cbd7b3234aed61036c951cd6188240b6504b /source/blender/python/intern/bpy_interface.c
parentb96d531bc97ec763e96a5f7a28993d70a0a9e637 (diff)
Fix T35176: Python fails with blend files from non-ASCII paths
Thanks to Tamito for updating the patch to support Freestyle!
Diffstat (limited to 'source/blender/python/intern/bpy_interface.c')
-rw-r--r--source/blender/python/intern/bpy_interface.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index 93bced364d2..99e741c8c94 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -463,12 +463,17 @@ static int python_script_exec(bContext *C, const char *fn, struct Text *text,
bpy_text_filename_get(fn_dummy, sizeof(fn_dummy), text);
if (text->compiled == NULL) { /* if it wasn't already compiled, do it now */
- char *buf = txt_to_buf(text);
+ char *buf;
+ PyObject *fn_dummy_py;
- text->compiled = Py_CompileString(buf, fn_dummy, Py_file_input);
+ fn_dummy_py = PyC_UnicodeFromByte(fn_dummy);
+ buf = txt_to_buf(text);
+ text->compiled = Py_CompileStringObject(buf, fn_dummy_py, Py_file_input, NULL, -1);
MEM_freeN(buf);
+ Py_DECREF(fn_dummy_py);
+
if (PyErr_Occurred()) {
if (do_jump) {
python_script_error_jump_text(text);