Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Lib/test/test_readline.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Very minimal unittests for parts of the readline module.
"""
import codecs
import locale
import os
import sys
Expand Down Expand Up @@ -228,6 +229,13 @@ def test_nonascii(self):
# writing and reading non-ASCII bytes into/from a TTY works, but
# readline or ncurses ignores non-ASCII bytes on read.
self.skipTest(f"the LC_CTYPE locale is {loc!r}")
if sys.flags.utf8_mode:
encoding = locale.getencoding()
encoding = codecs.lookup(encoding).name # normalize the name
if encoding != "utf-8":
# gh-133711: The Python UTF-8 Mode ignores the LC_CTYPE locale
# and always use the UTF-8 encoding.
self.skipTest(f"the LC_CTYPE encoding is {encoding!r}")

try:
readline.add_history("\xEB\xEF")
Expand Down
Loading