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 1
1
"""
2
2
Very minimal unittests for parts of the readline module.
3
3
"""
4
+ import codecs
4
5
import locale
5
6
import os
6
7
import sys
@@ -231,6 +232,13 @@ def test_nonascii(self):
231
232
# writing and reading non-ASCII bytes into/from a TTY works, but
232
233
# readline or ncurses ignores non-ASCII bytes on read.
233
234
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} " )
234
242
235
243
try :
236
244
readline .add_history ("\xEB \xEF " )
You can’t perform that action at this time.
0 commit comments