]> granicus.if.org Git - python/commitdiff
test_subprocess: use C locale to get ascii locale encoding
authorVictor Stinner <victor.stinner@haypocalc.com>
Thu, 14 Oct 2010 10:38:17 +0000 (10:38 +0000)
committerVictor Stinner <victor.stinner@haypocalc.com>
Thu, 14 Oct 2010 10:38:17 +0000 (10:38 +0000)
Lib/test/test_subprocess.py

index 6eff9e2bf3cbcb8e02c27f2659e24cc7bffe3fed..d7a157b7e568e5cbef88523b6e1299d7f72c0543 100644 (file)
@@ -885,6 +885,8 @@ class POSIXProcessTestCase(BaseTestCase):
             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 @@ class POSIXProcessTestCase(BaseTestCase):
             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)