Serhiy Storchaka added the comment:

The default encoding of sys.stdio and sys.stdout is determined by (in order of 
increasing precedence):

1. locale
2. PYTHONIOENCODING
3. Py_SetStandardStreamEncoding()

The default error handler before 3.5 was determined by:

1. 'strict'
2. PYTHONIOENCODING
3. Py_SetStandardStreamEncoding()

The default error handler since 3.5 (issue19977) is determined by:

1. PYTHONIOENCODING
2. locale
3. Py_SetStandardStreamEncoding()

Even if you explicitly specified the error handler by PYTHONIOENCODING, it 
doesn't have effect in POSIX locale. This doesn't look right to me. I think the 
order should be the same as for encoding.

Proposed patch makes PYTHONIOENCODING to override locale default for error 
handler.

----------
keywords: +patch
stage:  -> patch review
Added file: http://bugs.python.org/file41004/default_io_error_handle.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25339>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to