[Python-Dev] Python3 "complexity"

Baptiste Carvello devel at baptiste-carvello.net
Fri Jan 10 17:27:45 CET 2014


Le 10/01/2014 16:35, Nick Coghlan a écrit :

> One idea we're considering for Python 3.5 is to have a report of
> "ascii" on a POSIX OS imply the surrogateescape error handler (at
> least for the standard streams, and perhaps in other contexts), since
> the OS reporting the POSIX/C locale almost certainly indicates a
> configuration error rather than intentional behaviour.

would it make sense to be more general, and allow a "lenient mode",
where all files implicitly opened with the default encoding would also
use the surrogateescape error handler ?

That way, applications designed to process text mostly written in the
default encoding would just call sys.set_lenient_mode() and be done.

Of course, libraries would need to be strongly discouraged to ever use
this and encouraged to explicitly set the error handler on appropriate
files instead.

Cheers,

Baptiste



More information about the Python-Dev mailing list