[Python-Dev] Python 3.5 now uses surrogateescape for the POSIX locale (original) (raw)

Atsuo Ishimoto ishimoto at gembook.org
Tue Mar 18 11:02:14 CET 2014


Hello,

2014-03-18 18:13 GMT+09:00 Victor Stinner <victor.stinner at gmail.com>:

I'm not against backporting the change in Python 3.4.1. It can be seen as a bugfix. I don't think that anyone wants a Unicode error when reading or printing non-ASCII data from stdin/to stdout. But I would like the opinion of other developers before doing that.

FYI: Guido was opposed to change error handler of stdin and stdout years ago.

http://bugs.python.org/issue2630#msg65493

Amaury: I think it would be okay to use backslashreplace as the default error handler for sys.stderr. Probably not for sys.stdout or other files, since I'm sure many users prefer the errors when their data cannot be printed rather than silently writing \u escapes that might cause other code reading their output to choke. For sys.stderr though I think not having exceptions raised when attempting to print errors is very valuable.

-- Atsuo Ishimoto Mail: ishimoto at gembook.org Twitter: atsuoishimoto



More information about the Python-Dev mailing list