[Python-checkins] gh-91914: Fix test_curses on non-UTF-8 locale (GH-91919)

miss-islington webhook-mailer at python.org
Tue Apr 26 01:51:31 EDT 2022


https://github.com/python/cpython/commit/f4252dfb8edea01a892be8d29d3a0747e381eb4e
commit: f4252dfb8edea01a892be8d29d3a0747e381eb4e
branch: 3.9
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-04-25T22:51:27-07:00
summary:

gh-91914: Fix test_curses on non-UTF-8 locale (GH-91919)

(cherry picked from commit f41c16bf512778fca4bfabca887c4c303cc21896)

Co-authored-by: Serhiy Storchaka <storchaka at gmail.com>

files:
M Lib/test/test_curses.py

diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py
index 4bdc2379fd1ed..48b1d53f804bb 100644
--- a/Lib/test/test_curses.py
+++ b/Lib/test/test_curses.py
@@ -266,7 +266,12 @@ def test_output_character(self):
         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)
 



More information about the Python-checkins mailing list