File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 11"""
22Very minimal unittests for parts of the readline module.
33"""
4+ import codecs
45import locale
56import os
67import sys
@@ -231,6 +232,13 @@ def test_nonascii(self):
231232 # writing and reading non-ASCII bytes into/from a TTY works, but
232233 # readline or ncurses ignores non-ASCII bytes on read.
233234 self .skipTest (f"the LC_CTYPE locale is { loc !r} " )
235+ if sys .flags .utf8_mode :
236+ encoding = locale .getencoding ()
237+ encoding = codecs .lookup (encoding ).name # normalize the name
238+ if encoding != "utf-8" :
239+ # gh-133711: The Python UTF-8 Mode ignores the LC_CTYPE locale
240+ # and always use the UTF-8 encoding.
241+ self .skipTest (f"the LC_CTYPE encoding is { encoding !r} " )
234242
235243 try :
236244 readline .add_history ("\xEB \xEF " )
You can’t perform that action at this time.
0 commit comments