diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-08-25 08:33:34 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-08-25 08:33:34 (GMT) |
commit | ef6ff662c933f43df5bba40032de2d718f4e1fd8 (patch) | |
tree | 76025d696740f038eff639ef01110322be05c344 /Lib/test/test_sys.py | |
parent | 112c0f34119fb2fe127bf54393bf06f5c334836a (diff) | |
download | cpython-ef6ff662c933f43df5bba40032de2d718f4e1fd8.zip cpython-ef6ff662c933f43df5bba40032de2d718f4e1fd8.tar.gz cpython-ef6ff662c933f43df5bba40032de2d718f4e1fd8.tar.bz2 |
Fix test_sys: set LC_ALL instead of LANG
LC_ALL is read before LANG to choose the locale encoding (LC_ALL, LANG and then
LC_CTYPE: use the first non empty variable).
Diffstat (limited to 'Lib/test/test_sys.py')
-rw-r--r-- | Lib/test/test_sys.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index ee8df4d..8cfbaaf 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -507,7 +507,8 @@ class SysModuleTest(unittest.TestCase): undecodable = b"\xff" env = os.environ.copy() - env['LANG'] = 'C' + # Use C locale to get ascii for the locale encoding + env['LC_ALL'] = 'C' code = ( b'import locale; ' b'print(ascii("' + undecodable + b'"), ' @@ -614,9 +615,9 @@ class SysModuleTest(unittest.TestCase): # Raise SkipTest() if sys.executable is not encodable to ascii test.support.workaroundIssue8611() - # Even in C locale + # Use C locale to get ascii for the locale encoding env = os.environ.copy() - env['LANG'] = 'C' + env['LC_ALL'] = 'C' try: del env['PYTHONFSENCODING'] except KeyError: |