]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.7] bpo-34485: stdout uses surrogateescape on POSIX locale (GH-8986) (GH-8987)
authorVictor Stinner <vstinner@redhat.com>
Wed, 29 Aug 2018 09:01:33 +0000 (11:01 +0200)
committerGitHub <noreply@github.com>
Wed, 29 Aug 2018 09:01:33 +0000 (11:01 +0200)
commit0b9ea4b211b24464c7d38f63e45e51c275c52dcd
treea2935b5f8ae0eaaf627d4536e75cc608df697734
parent98c49c6ab239875e35a3c271bc8fabde6c9be804
[3.7] bpo-34485: stdout uses surrogateescape on POSIX locale (GH-8986) (GH-8987)

* bpo-34485: stdout uses surrogateescape on POSIX locale (GH-8986)

Standard streams like sys.stdout now use the "surrogateescape" error
handler, instead of "strict", on the POSIX locale (when the C locale is not
coerced and the UTF-8 Mode is disabled).

Add tests on sys.stdout.errors with LC_ALL=POSIX.

Fix the error handler of standard streams like sys.stdout:
PYTHONIOENCODING=":" is now ignored instead of setting the error handler to
"strict".

(cherry picked from commit 315877dc361d554bec34b4b62c270479ad36a1be)
Lib/test/test_sys.py
Lib/test/test_utf8_mode.py
Misc/NEWS.d/next/Core and Builtins/2018-08-28-23-01-14.bpo-34485.dq1Kqk.rst [new file with mode: 0644]
Misc/NEWS.d/next/Core and Builtins/2018-08-29-09-27-47.bpo-34485.5aJCmw.rst [new file with mode: 0644]
Python/pylifecycle.c