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:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2014-06-16 09:24:19 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-06-16 09:29:25 +0400
commitf325ddb0d7f876587f12464fab51810f118ee06d (patch)
tree12bd527e0d962697fe33d16dd72849956c1d367e /source/blender/python
parent8365cebe32089dc1dc962a42361ceea936ffe82d (diff)
Fix Python fails to execute text-blocks including non-mbcs chars (T35176, D595)
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/generic/py_capi_utils.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c
index 33ff63a9a28..c0004789faa 100644
--- a/source/blender/python/generic/py_capi_utils.c
+++ b/source/blender/python/generic/py_capi_utils.c
@@ -543,8 +543,9 @@ PyObject *PyC_DefaultNameSpace(const char *filename)
Py_DECREF(mod_main); /* sys.modules owns now */
PyModule_AddStringConstant(mod_main, "__name__", "__main__");
if (filename) {
- /* __file__ mainly for nice UI'ness */
- PyModule_AddObject(mod_main, "__file__", PyUnicode_DecodeFSDefault(filename));
+ /* __file__ mainly for nice UI'ness
+ * note: this wont map to a real file when executing text-blocks and buttons. */
+ PyModule_AddObject(mod_main, "__file__", PyC_UnicodeFromByte(filename));
}
PyModule_AddObject(mod_main, "__builtins__", interp->builtins);
Py_INCREF(interp->builtins); /* AddObject steals a reference */