[Bf-committers] Python console IO encoding: PYTHONIOENCODING envvar

Bastien Montagne montagne29 at wanadoo.fr
Mon Sep 16 08:17:47 CEST 2013


Hi Campbell,

Could we consider using stderr in these cases, as a temp workaround? 
 From doc, "For stderr, the :errorhandler part is ignored; the handler 
will always be 'backslashreplace'.", and indeed a quick test (under 
linux) prints escapes codes in an ASCII console, instead of erroring...

On 14/09/2013 02:40, Campbell Barton wrote:
> On Fri, Sep 13, 2013 at 11:02 PM, Bastien Montagne
> <montagne29 at wanadoo.fr>  wrote:
>> Hey devs,
>>
>> Just ran into this bug report:
>> https://projects.blender.org/tracker/?func=detail&atid=498&aid=36722&group_id=9
>>
>> Most likely, it is an issue of non-encodable char in its path (stupid
>> windows...)
>>
>> Anyway, searching a bit around, I found PYTHONIOENCODING envvar
>> (http://docs.python.org/3/using/cmdline.html#envvar-PYTHONIOENCODING),
>> which is supposed to force encoding of stdXXX streams. Are we already
>> using this, or wouldn't it work in our case? Else, setting it to
>> something like "utf-8:replace" could save us some issues under windows...
> Afraid its a known issue, see comment in BPY_python_start():
> 'PYTHONIOENCODING' is ignored in MS-Windows
>
> bug report:
> https://projects.blender.org/tracker/?func=detail&aid=31555
>
> upstream report to CPython:
> http://bugs.python.org/issue16129
>


More information about the Bf-committers mailing list