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>2012-10-02 17:24:28 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-10-02 17:24:28 +0400
commit75fff053483341d1b163c14bf6b18019c077f5dd (patch)
treebacb56fcf05cf9c4c10648b73e36bcab71067b05
parent78d6288be33a45f5a4227941c238f5de92da24fb (diff)
revert fix for [#31555] Username with special chars in Windows 7
this breaks and causes bug: [#32720], where sys.stdout becomes invalid and print() does nothing. On investigation - python is not getting the environment variable from blender (aparently because its a DLL?) so this should be resolved rather then overwriting sys.stdout.
-rw-r--r--source/blender/python/intern/bpy_interface.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index d5ef6905b51..b628f42e759 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -251,6 +251,10 @@ void BPY_python_start(int argc, const char **argv)
* an error, this is highly annoying, another stumbling block for devs,
* so use a more relaxed error handler and enforce utf-8 since the rest of
* blender is utf-8 too - campbell */
+
+ /* XXX, update: this is unreliable! 'PYTHONIOENCODING' is ignored in MS-Windows
+ * when dynamically linked, see: [#31555] for details.
+ * Python doesn't expose a good way to set this. */
BLI_setenv("PYTHONIOENCODING", "utf-8:surrogateescape");
/* Python 3.2 now looks for '2.xx/python/include/python3.2d/pyconfig.h' to
@@ -264,15 +268,6 @@ 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? */
{