]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-91914: Fix test_curses on non-UTF-8 locale (GH-91919)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 26 Apr 2022 05:57:57 +0000 (22:57 -0700)
committerGitHub <noreply@github.com>
Tue, 26 Apr 2022 05:57:57 +0000 (22:57 -0700)
(cherry picked from commit f41c16bf512778fca4bfabca887c4c303cc21896)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Lib/test/test_curses.py

index d3c152c42cf62f5c61ba7eb4e44728546c3ca672..b550f4af555ce4e96bf9ad6aff23ff798bf5dc79 100644 (file)
@@ -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)