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
Expand Up @@ -3,6 +3,7 @@
"""
from contextlib import ExitStack
from errno import EIO
import locale
import os
import selectors
import subprocess
Expand Down Expand Up @@ -137,6 +138,13 @@ def test_auto_history_disabled(self):
self.assertIn(b"History length: 0\r\n", output)

def test_nonascii(self):
loc = locale.setlocale(locale.LC_CTYPE, None)
if loc in ('C', 'POSIX'):
# bpo-29240: On FreeBSD, if the LC_CTYPE locale is C or POSIX,
# 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}")

try:
readline.add_history("\xEB\xEF")
except UnicodeEncodeError as err:
Expand Down