summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2018-01-16 16:34:34 (GMT)
committerGitHub <noreply@github.com>2018-01-16 16:34:34 (GMT)
commitc495e799ed376af91ae2ddf6c4bcc592490fe294 (patch)
treec0cf44d10da11fe684fb03a743e64366d95c1a8d
parent4d9aec022063dcfc4cf40ae46b1c4a968297e664 (diff)
downloadcpython-c495e799ed376af91ae2ddf6c4bcc592490fe294.zip
cpython-c495e799ed376af91ae2ddf6c4bcc592490fe294.tar.gz
cpython-c495e799ed376af91ae2ddf6c4bcc592490fe294.tar.bz2
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.
-rw-r--r--Lib/test/test_readline.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_readline.py b/Lib/test/test_readline.py
index b4c25de..67ee9b7 100644
--- a/Lib/test/test_readline.py
+++ b/Lib/test/test_readline.py
@@ -3,6 +3,7 @@ Very minimal unittests for parts of the readline module.
"""
from contextlib import ExitStack
from errno import EIO
+import locale
import os
import selectors
import subprocess
@@ -153,6 +154,13 @@ print("History length:", readline.get_current_history_length())
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: