summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-10-14 10:43:31 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-10-14 10:43:31 (GMT)
commit89f3ad10d2bf762126bee3c5fadf19c3c7bf2f52 (patch)
tree040a6b7149c0b3275c188c81225fbbb7604db2a0 /Lib
parentebc78d23efca42d491da76151f3c4c839f3c42dc (diff)
downloadcpython-89f3ad10d2bf762126bee3c5fadf19c3c7bf2f52.zip
cpython-89f3ad10d2bf762126bee3c5fadf19c3c7bf2f52.tar.gz
cpython-89f3ad10d2bf762126bee3c5fadf19c3c7bf2f52.tar.bz2
test_subprocess doesn't need to C locale to test os.environb
Improve also the comment to explain why C locale is needed to test os.environ.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_subprocess.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index d7a157b..c21de19 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -885,7 +885,9 @@ 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
+ # Use C locale to get ascii for the locale encoding to force
+ # surrogate-escaping of \xFF in the child process; otherwise it can
+ # be decoded as-is if the default locale is latin-1.
env['LC_ALL'] = 'C'
stdout = subprocess.check_output(
[sys.executable, "-c", script],
@@ -899,8 +901,6 @@ 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)