From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 26 Apr 2022 05:51:27 +0000 (-0700) Subject: gh-91914: Fix test_curses on non-UTF-8 locale (GH-91919) X-Git-Tag: v3.9.13~80 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f4252dfb8edea01a892be8d29d3a0747e381eb4e;p=thirdparty%2FPython%2Fcpython.git gh-91914: Fix test_curses on non-UTF-8 locale (GH-91919) (cherry picked from commit f41c16bf512778fca4bfabca887c4c303cc21896) Co-authored-by: Serhiy Storchaka --- diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py index 4bdc2379fd1e..48b1d53f804b 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)