Xavier de Gaye added the comment: > test_ioencoding_nonascii does not fail when LANG is set to en_GB.UTF-8 in the > environment.
When LANG is not set, we have on an android emulator: >>> from test.support import FS_NONASCII >>> print(FS_NONASCII) Traceback (most recent call last): File "<stdin>", line 1, in <module> UnicodeEncodeError: 'ascii' codec can't encode character '\xe6' in position 0: ordinal not in range(128) But on linux when LANG is not set: $ LANG= ./python Python 3.6.0a0 (default:eee959fee5f5+, May 13 2016, 11:32:27) [GCC 6.1.1 20160501] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from test.support import FS_NONASCII >>> print(FS_NONASCII) None >>> And test_ioencoding_nonascii is skipped accordingly on linux for the following printed reason: 'requires OS support of non-ASCII encodings'. On Android, os.fsdecode(os.fsencode('\xe6')) does not raise UnicodeError in the test.support module. And locale.getpreferredencoding() returns 'ascii'. So it seems that this criterion (FS_NONASCII is not None) is not sufficient to decide when this test should be run and not skipped. ---------- nosy: +haypo _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26920> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com