mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
test_subprocess: use C locale to get ascii locale encoding
This commit is contained in:
parent
f5247e35c1
commit
ebc78d23ef
1 changed files with 4 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue