[Python-checkins] Skip test_readline.test_nonascii() on C locale (#5203)
Victor Stinner
webhook-mailer at python.org
Tue Jan 16 11:34:37 EST 2018
https://github.com/python/cpython/commit/c495e799ed376af91ae2ddf6c4bcc592490fe294
commit: c495e799ed376af91ae2ddf6c4bcc592490fe294
branch: master
author: Victor Stinner <victor.stinner at gmail.com>
committer: GitHub <noreply at github.com>
date: 2018-01-16T17:34:34+01:00
summary:
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.
files:
M Lib/test/test_readline.py
diff --git a/Lib/test/test_readline.py b/Lib/test/test_readline.py
index b4c25dee9d3..67ee9b7f7cf 100644
--- a/Lib/test/test_readline.py
+++ b/Lib/test/test_readline.py
@@ -3,6 +3,7 @@
"""
from contextlib import ExitStack
from errno import EIO
+import locale
import os
import selectors
import subprocess
@@ -153,6 +154,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:
More information about the Python-checkins
mailing list