diff options
author | Xavier de Gaye <xdegaye@users.sourceforge.net> | 2016-12-15 19:59:58 (GMT) |
---|---|---|
committer | Xavier de Gaye <xdegaye@users.sourceforge.net> | 2016-12-15 19:59:58 (GMT) |
commit | 76febd079299d64abffee0bdd7c4c1785e5a0fa7 (patch) | |
tree | 517048da532d163551a4a349ad3b8f0e1e5514d8 /Lib/test | |
parent | 3d3f264849580ab1e8f3a8e8e8ba402bfe2c6523 (diff) | |
download | cpython-76febd079299d64abffee0bdd7c4c1785e5a0fa7.zip cpython-76febd079299d64abffee0bdd7c4c1785e5a0fa7.tar.gz cpython-76febd079299d64abffee0bdd7c4c1785e5a0fa7.tar.bz2 |
Issue #26919: On Android, operating system data is now always encoded/decoded
to/from UTF-8, instead of the locale encoding to avoid inconsistencies with
os.fsencode() and os.fsdecode() which are already using UTF-8.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_cmd_line.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py index b71bb9f..ae2bcd4 100644 --- a/Lib/test/test_cmd_line.py +++ b/Lib/test/test_cmd_line.py @@ -8,7 +8,7 @@ import shutil import sys import subprocess import tempfile -from test.support import script_helper +from test.support import script_helper, is_android from test.support.script_helper import (spawn_python, kill_python, assert_python_ok, assert_python_failure) @@ -178,15 +178,16 @@ class CmdLineTest(unittest.TestCase): if not stdout.startswith(pattern): raise AssertionError("%a doesn't start with %a" % (stdout, pattern)) - @unittest.skipUnless(sys.platform == 'darwin', 'test specific to Mac OS X') - def test_osx_utf8(self): + @unittest.skipUnless((sys.platform == 'darwin' or + is_android), 'test specific to Mac OS X and Android') + def test_osx_android_utf8(self): def check_output(text): decoded = text.decode('utf-8', 'surrogateescape') expected = ascii(decoded).encode('ascii') + b'\n' env = os.environ.copy() # C locale gives ASCII locale encoding, but Python uses UTF-8 - # to parse the command line arguments on Mac OS X + # to parse the command line arguments on Mac OS X and Android. env['LC_ALL'] = 'C' p = subprocess.Popen( |