From f41c16bf512778fca4bfabca887c4c303cc21896 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Tue, 26 Apr 2022 07:59:56 +0300 Subject: [PATCH] gh-91914: Fix test_curses on non-UTF-8 locale (GH-91919) --- Lib/test/test_curses.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py index d3c152c42cf..b550f4af555 100644 --- a/Lib/test/test_curses.py +++ b/Lib/test/test_curses.py @@ -268,7 +268,12 @@ class TestCurses(unittest.TestCase): stdscr.echochar(b'A') stdscr.echochar(65) with self.assertRaises((UnicodeEncodeError, OverflowError)): - stdscr.echochar('\u20ac') + # Unicode is not fully supported yet, but at least it does + # not crash. + # It is supposed to fail because either the character is + # not encodable with the current encoding, or it is encoded to + # a multibyte sequence. + stdscr.echochar('\u0114') stdscr.echochar('A', curses.A_BOLD) self.assertIs(stdscr.is_wintouched(), False)