cpython: bc06f67234d0 (original) (raw)

Mercurial > cpython

changeset 89836:bc06f67234d0

Issue #19977: When the ``LC_TYPE`` locale is the POSIX locale (``C`` locale), :py:data:`sys.stdin` and :py:data:`sys.stdout` are now using the ``surrogateescape`` error handler, instead of the ``strict`` error handler. [#19977]

Victor Stinner victor.stinner@gmail.com
date Tue, 18 Mar 2014 01🔞21 +0100
parents daa6bf71170f
children f6794a0fb2b3
files Doc/whatsnew/3.5.rst Lib/test/test_sys.py Misc/NEWS Python/pythonrun.c
diffstat 4 files changed, 62 insertions(+), 2 deletions(-)[+] [-] Doc/whatsnew/3.5.rst 5 Lib/test/test_sys.py 44 Misc/NEWS 4 Python/pythonrun.c 11

line wrap: on

line diff

--- a/Doc/whatsnew/3.5.rst +++ b/Doc/whatsnew/3.5.rst @@ -79,7 +79,10 @@ New built-in features: Implementation improvements: -* None yet. +* When the LC_TYPE locale is the POSIX locale (C locale),

--- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -615,6 +615,50 @@ class SysModuleTest(unittest.TestCase): expected = None self.check_fsencoding(fs_encoding, expected)

+

+

+ def test_implementation(self): # This test applies to all implementations equally.

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -13,6 +13,10 @@ Core and Builtins Library ------- +- Issue #19977: When the LC_TYPE locale is the POSIX locale (C locale),

--- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -1156,6 +1156,15 @@ initstdio(void) encoding = _Py_StandardStreamEncoding; errors = _Py_StandardStreamErrors; if (!encoding || !errors) {

+ pythonioencoding = Py_GETENV("PYTHONIOENCODING"); if (pythonioencoding) { char *err; @@ -1168,7 +1177,7 @@ initstdio(void) if (err) { *err = '\0'; err++;