Merged changes in the trunk up to revision 50607.
Conflicts resolved: source/blender/blenloader/intern/readfile.c
This commit is contained in:
@@ -163,8 +163,17 @@ void bpy_context_clear(bContext *UNUSED(C), PyGILState_STATE *gilstate)
|
||||
void BPY_text_free_code(Text *text)
|
||||
{
|
||||
if (text->compiled) {
|
||||
PyGILState_STATE gilstate;
|
||||
int use_gil = !PYC_INTERPRETER_ACTIVE;
|
||||
|
||||
if (use_gil)
|
||||
gilstate = PyGILState_Ensure();
|
||||
|
||||
Py_DECREF((PyObject *)text->compiled);
|
||||
text->compiled = NULL;
|
||||
|
||||
if (use_gil)
|
||||
PyGILState_Release(gilstate);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,6 +263,15 @@ void BPY_python_start(int argc, const char **argv)
|
||||
|
||||
Py_Initialize();
|
||||
|
||||
#ifdef WIN32
|
||||
/* this is disappointing, its likely a bug in python?
|
||||
* for some reason 'PYTHONIOENCODING' is ignored in windows
|
||||
* see: [#31555] for details. */
|
||||
PyRun_SimpleString("import sys, io\n"
|
||||
"sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='surrogateescape', line_buffering=True)\n"
|
||||
"sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8', errors='surrogateescape', line_buffering=True)\n");
|
||||
#endif /* WIN32 */
|
||||
|
||||
// PySys_SetArgv(argc, argv); // broken in py3, not a huge deal
|
||||
/* sigh, why do python guys not have a (char **) version anymore? */
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user