Antoine Pitrou added the comment: > See my message msg195769: Python3 cannot be simply used as a pipe > because it wants to be kind by decoding binary data to Unicode, > whereas no everybody cares of Unicode :-)
If somebody doesn't care about unicode, they can use sys.stdin.buffer. Problem solved :-) Note: enabling surrogateescape on stdin enables precisely the "exception being raised far from the source of the problem" people are afraid of. surrogateescape on stdin allows invalid unicode strings to slip into your application, only for a later encoding to utf-8 to fail (since lone surrogates are not allowed). For example if you are sending that user data over an utf-8 network protocol (perhaps JSON-encoded or XML-encoded)... ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue18713> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com