New submission from STINNER Victor: As a following of the issue #19977, I propose to use also the surrogateescape error handler in open() by default if the locale is C.
Attached issue adds a new sys.getdefaulterrorhandler() function and use it in io.TextIOWrapper (and _pyio.TextIOWrapper). We may use sys.getdefaulterrorhandler() in more places. I don't think that it would be correct to use in for str.encode() or bytes.decode(). ---------- components: Unicode files: default_error_handler.patch keywords: patch messages: 241405 nosy: ezio.melotti, haypo, ncoghlan priority: normal severity: normal status: open title: Use surrogateescape error handler by default in open() if the locale is C versions: Python 3.5 Added file: http://bugs.python.org/file39100/default_error_handler.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23993> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com