]> 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:51:27 +0000 (22:51 -0700)
committerGitHub <noreply@github.com>
Tue, 26 Apr 2022 05:51:27 +0000 (22:51 -0700)
(cherry picked from commit f41c16bf512778fca4bfabca887c4c303cc21896)

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

index 4bdc2379fd1edf6e833be9c629fa877810ea9b50..48b1d53f804bb20007f297cd2d41ea0e10421196 100644 (file)
@@ -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)