Le 24/03/2017 à 17:37, Victor Stinner a écrit :
> *If* we change something, I would prefer to modify sys.stdout. The
> following issue proposes to add
> sys.stdout.set_encoding(errors='replace'):
> http://bugs.python.org/issue15216
> 
> You can already set the PYTHONIOENCODING environment variable to
> ":replace" to use "replace" on sys.stdout (and sys.stderr).
> 
> Victor

This is not the same. You may want to locally apply "errors=replace" and
not the whole program.

Indeed, this can silence encoding problems. So I would probably never
set in to errors at dev time except for the few places where I know I
can explicitly silence errors.

I quite like this print(errors="replace|ignore"). This is not going to
cause any trouble, and can only help.

_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to