◐ Shell
clean mode source ↗

bpo-34485: Enhance init_sys_streams() by vstinner · Pull Request #8978 · python/cpython

Python now gets the locale encoding with C code to initialize the encoding
of standard streams like sys.stdout. Moreover, the encoding is now
initialized to the Python codec name to get a normalized encoding name and
to ensure that the codec is loaded. The change avoids importing
_bootlocale and _locale modules at startup by default.

When the PYTHONIOENCODING environment variable only contains an encoding,
the error handler is now is now set explicitly to "strict".

https://bugs.python.org/issue34485