Skip to content

Commit c495e79

Browse files
authored
Skip test_readline.test_nonascii() on C locale (#5203)
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.
1 parent 4d9aec0 commit c495e79

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Lib/test/test_readline.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44
from contextlib import ExitStack
55
from errno import EIO
6+
import locale
67
import os
78
import selectors
89
import subprocess
@@ -153,6 +154,13 @@ def test_auto_history_disabled(self):
153154
self.assertIn(b"History length: 0\r\n", output)
154155

155156
def test_nonascii(self):
157+
loc = locale.setlocale(locale.LC_CTYPE, None)
158+
if loc in ('C', 'POSIX'):
159+
# bpo-29240: On FreeBSD, if the LC_CTYPE locale is C or POSIX,
160+
# writing and reading non-ASCII bytes into/from a TTY works, but
161+
# readline or ncurses ignores non-ASCII bytes on read.
162+
self.skipTest(f"the LC_CTYPE locale is {loc!r}")
163+
156164
try:
157165
readline.add_history("\xEB\xEF")
158166
except UnicodeEncodeError as err:

0 commit comments

Comments
 (0)