summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_cmd_line.py
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2017-06-11 03:16:15 (GMT)
committerGitHub <noreply@github.com>2017-06-11 03:16:15 (GMT)
commit6ea4186de32d65b1f1dc1533b6312b798d300466 (patch)
treebac8387f2da20d5b6d5f74bb09fb5708d1fbd61e /Lib/test/test_cmd_line.py
parent0afbabe245e2eb6f7cef3b70531d69f2a7ad8295 (diff)
downloadcpython-6ea4186de32d65b1f1dc1533b6312b798d300466.zip
cpython-6ea4186de32d65b1f1dc1533b6312b798d300466.tar.gz
cpython-6ea4186de32d65b1f1dc1533b6312b798d300466.tar.bz2
bpo-28180: Implementation for PEP 538 (#659)
- new PYTHONCOERCECLOCALE config setting - coerces legacy C locale to C.UTF-8, C.utf8 or UTF-8 by default - always uses C.UTF-8 on Android - uses `surrogateescape` on stdin and stdout in the coercion target locales - configure option to disable locale coercion at build time - configure option to disable C locale warning at build time
Diffstat (limited to 'Lib/test/test_cmd_line.py')
-rw-r--r--Lib/test/test_cmd_line.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py
index 5f96d61..3e20427 100644
--- a/Lib/test/test_cmd_line.py
+++ b/Lib/test/test_cmd_line.py
@@ -8,8 +8,9 @@ import sys
import subprocess
import tempfile
from test.support import script_helper, is_android
-from test.support.script_helper import (spawn_python, kill_python, assert_python_ok,
- assert_python_failure)
+from test.support.script_helper import (
+ spawn_python, kill_python, assert_python_ok, assert_python_failure
+)
# XXX (ncoghlan): Move to script_helper and make consistent with run_python
@@ -150,6 +151,7 @@ class CmdLineTest(unittest.TestCase):
env = os.environ.copy()
# Use C locale to get ascii for the locale encoding
env['LC_ALL'] = 'C'
+ env['PYTHONCOERCECLOCALE'] = '0'
code = (
b'import locale; '
b'print(ascii("' + undecodable + b'"), '