summaryrefslogtreecommitdiff
path: root/Lib/test/test_cmd_line.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_cmd_line.py')
-rw-r--r--Lib/test/test_cmd_line.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py
index 21511b896c..7e967b20ab 100644
--- a/Lib/test/test_cmd_line.py
+++ b/Lib/test/test_cmd_line.py
@@ -159,13 +159,16 @@ 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'"), '
b'locale.getpreferredencoding())')
p = subprocess.Popen(
- [sys.executable, "-c", code],
+ [sys.executable,
+ # Disable C locale coercion and UTF-8 Mode to not use UTF-8
+ "-X", "coerce_c_locale=0",
+ "-X", "utf8=0",
+ "-c", code],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
env=env)
stdout, stderr = p.communicate()