diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2012-11-06 22:43:21 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2012-11-06 22:43:21 (GMT) |
commit | ab8b6bd7fbd9fafa334c24c9928496e9bf5afb82 (patch) | |
tree | 501407234a79cbf571ebbd51d8ac27193521f304 /Lib/test/support.py | |
parent | 90a9d511372fbaa75215183a9fe60302b1e10983 (diff) | |
download | cpython-ab8b6bd7fbd9fafa334c24c9928496e9bf5afb82.zip cpython-ab8b6bd7fbd9fafa334c24c9928496e9bf5afb82.tar.gz cpython-ab8b6bd7fbd9fafa334c24c9928496e9bf5afb82.tar.bz2 |
Issue #16414: Test more characters for support.FS_NONASCII
It should increase the probability of finding a non-ASCII character on any
locale encoding.
Diffstat (limited to 'Lib/test/support.py')
-rw-r--r-- | Lib/test/support.py | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/Lib/test/support.py b/Lib/test/support.py index abceca3..ec4b47d 100644 --- a/Lib/test/support.py +++ b/Lib/test/support.py @@ -607,20 +607,37 @@ TESTFN = "{}_{}_tmp".format(TESTFN, os.getpid()) # or None if there is no such character. FS_NONASCII = None for character in ( - # U+00E6 (Latin small letter AE): Encodable to cp1252, cp1254, cp1257, iso-8859-1 + # First try printable and common characters to have a readable filename. + # For each character, the encoding list are just example of encodings able + # to encode the character (the list is not exhaustive). + + # U+00E6 (Latin Small Letter Ae): cp1252, iso-8859-1 '\u00E6', - # U+0141 (Latin capital letter L with stroke): Encodable to cp1250, cp1257 + # U+0130 (Latin Capital Letter I With Dot Above): cp1254, iso8859_3 + '\u0130', + # U+0141 (Latin Capital Letter L With Stroke): cp1250, cp1257 '\u0141', - # U+041A (Cyrillic capital letter KA): Encodable to cp932, cp950, cp1251 + # U+03C6 (Greek Small Letter Phi): cp1253 + '\u03C6', + # U+041A (Cyrillic Capital Letter Ka): cp1251 '\u041A', - # U+05D0 (Hebrew Letter Alef): Encodable to cp424, cp1255 + # U+05D0 (Hebrew Letter Alef): Encodable to cp424 '\u05D0', - # U+06A9 (Arabic letter KEHEH): Encodable to cp1256 - '\u06A9', - # U+03A9 (Greek capital letter OMEGA): Encodable to cp932, cp950, cp1253 - '\u03A9', - # U+0E01 (Thai character KO KAI): Encodable to cp874 + # U+060C (Arabic Comma): cp864, cp1006, iso8859_6, mac_arabic + '\u060C', + # U+062A (Arabic Letter Teh): cp720 + '\u062A', + # U+0E01 (Thai Character Ko Kai): cp874 '\u0E01', + + # Then try more "special" characters. "special" because they may be + # interpreted or displayed differently depending on the exact locale + # encoding and the font. + + # U+00A0 (No-Break Space) + '\u00A0', + # U+20AC (Euro Sign) + '\u20AC', ): try: os.fsdecode(os.fsencode(character)) |