diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 6eff9e2bf3c..d7a157b7e56 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -885,6 +885,8 @@ def test_undecodable_env(self): script = "import os; print(ascii(os.getenv(%s)))" % repr(key) env = os.environ.copy() env[key] = value + # Use C locale to get ascii for the locale encoding + env['LC_ALL'] = 'C' stdout = subprocess.check_output( [sys.executable, "-c", script], env=env) @@ -897,6 +899,8 @@ def test_undecodable_env(self): script = "import os; print(ascii(os.getenvb(%s)))" % repr(key) env = os.environ.copy() env[key] = value + # Use C locale to get ascii for the locale encoding + env['LC_ALL'] = 'C' stdout = subprocess.check_output( [sys.executable, "-c", script], env=env)