[issue25339] sys.stdout.errors is set to "surrogateescape"

2016-04-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your review Victor. I have added yet one minor change in tests because -I doesn't suppress PYTHONIOENCODING. -- assignee: -> serhiy.storchaka resolution: -> fixed stage: patch review -> resolved status: open -> closed

[issue25339] sys.stdout.errors is set to "surrogateescape"

2016-04-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset 56eca1c08738 by Serhiy Storchaka in branch '3.5': Issue #25339: PYTHONIOENCODING now has priority over locale in setting the https://hg.python.org/cpython/rev/56eca1c08738 New changeset 9c6623099da1 by Serhiy Storchaka in branch 'default': Issue #25

[issue25339] sys.stdout.errors is set to "surrogateescape"

2016-04-09 Thread STINNER Victor
STINNER Victor added the comment: The patch looks good to me. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue25339] sys.stdout.errors is set to "surrogateescape"

2016-04-09 Thread STINNER Victor
STINNER Victor added the comment: Ok, I now understand the issue. Your change looks good to me. I agree that strict error handler is good choice for PYTHONIOENCODING=ascii. -- ___ Python tracker __

[issue25339] sys.stdout.errors is set to "surrogateescape"

2016-04-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Making "PYTHONIOENCODING=ascii" to mean "PYTHONIOENCODING=ascii:surrogateescape" is different (and may be more complex) issue. What error handler should use open(name, encoding='ascii')? open(name) in POSIX locale? This issue is about incorrect working of P

[issue25339] sys.stdout.errors is set to "surrogateescape"

2016-04-08 Thread Nick Coghlan
Nick Coghlan added the comment: I believe the problem may be that we can't readily tell the difference between "PYTHONIOENCODING=ascii" and "PYTHONIOENCODING=ascii:strict", and in the former case we'd ideally still end up using "surrogateescape" by default. That said, the real intent of the ch

[issue25339] sys.stdout.errors is set to "surrogateescape"

2016-04-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What do you think about this Victor? -- ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue25339] sys.stdout.errors is set to "surrogateescape"

2015-11-10 Thread Serhiy Storchaka
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.

[issue25339] sys.stdout.errors is set to "surrogateescape"

2015-10-14 Thread STINNER Victor
STINNER Victor added the comment: "it looks at least unexpected, that surrogateescape is used with non-ASCII encoding" What do you mean by non-ASCII encoding? surrogateescape is used by all encodings for all OS operations on Python 3, like os.listdir(), even for UTF-8. -- ___

[issue25339] sys.stdout.errors is set to "surrogateescape"

2015-10-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm not sure this is a bug, but it looks at least unexpected, that surrogateescape is used with non-ASCII encoding. For example my last test for issue19058 fails on POSIX locale in 3.5+, and it is not so easy to make it working. May be change error handler

[issue25339] sys.stdout.errors is set to "surrogateescape"

2015-10-14 Thread STINNER Victor
STINNER Victor added the comment: Sorry, I don't understand the issue. Do you consider that using surrogateescape is a bug? Which behaviour do you expect? Python 3.5 now uses surrogateescape by default for stdout and stderr when the locale is POSIX. I guess that you got the POSIX locale using

[issue25339] sys.stdout.errors is set to "surrogateescape"

2015-10-07 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: The error handler of sys.stdout and sys.stdin is set to "surrogateescape" even for non-ASCII encoding. $ LANG= PYTHONIOENCODING=UTF-8 ./python -c 'import sys; print(sys.stdout.encoding, sys.stdout.errors)' UTF-8 surrogateescape -- components: IO m