Author vstinner
Recipients Arfrever, a.badger, abadger1999, benjamin.peterson, ezio.melotti, lemburg, ncoghlan, pitrou, r.david.murray, serhiy.storchaka, vstinner
Date 2013-08-22.09:12:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAMpsgwYJa2rL3529z+qO7u3W3Z_P8fKky7dUKrXQa=CBRa6h1Q@mail.gmail.com>
In-reply-to <1377160631.39.0.853590295401.issue18713@psf.upfronthosting.co.za>
Content
Serhiy Storchaka added the comment:
> Shouldn't be safer use surrogateescape for output and strict for input.

Nick wrote "Think sysadmins running scripts on Linux, writing to the
console or a pipe."

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 :-)

Hum, I realized that the subprocess should also be patched to be
consistent: subprocess already uses surrogateescape for the command
line arguments and environment variables, why not using the same error
handler for stdin, stdout and stderr?

Serhiy Storchaka also noticed (in the review of my patch) than errors
is "strict" when PYTHONIOENCODING=utf-8 is used. We should also use
surrogateescape if only the encoding is changed.
History
Date User Action Args
2013-08-22 09:12:47vstinnersetrecipients: + vstinner, lemburg, ncoghlan, pitrou, abadger1999, benjamin.peterson, ezio.melotti, a.badger, Arfrever, r.david.murray, serhiy.storchaka
2013-08-22 09:12:47vstinnerlinkissue18713 messages
2013-08-22 09:12:46vstinnercreate