From f4252dfb8edea01a892be8d29d3a0747e381eb4e Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Mon, 25 Apr 2022 22:51:27 -0700 Subject: [PATCH] gh-91914: Fix test_curses on non-UTF-8 locale (GH-91919) (cherry picked from commit f41c16bf512778fca4bfabca887c4c303cc21896) Co-authored-by: Serhiy Storchaka --- 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 4bdc2379fd1..48b1d53f804 100644 --- a/Lib/test/test_curses.py +++ b/Lib/test/test_curses.py @@ -266,7 +266,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)