summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_curses.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-11-28 06:26:19 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-11-28 06:26:19 (GMT)
commitd1b097f8844d5e711c55874baba45b792cf46055 (patch)
treeee655a88dfff7570f49091b03bf4193f7802f84b /Lib/test/test_curses.py
parenteee0e4416470da63f26d5707e4b6f1ea9ad80409 (diff)
downloadcpython-d1b097f8844d5e711c55874baba45b792cf46055.zip
cpython-d1b097f8844d5e711c55874baba45b792cf46055.tar.gz
cpython-d1b097f8844d5e711c55874baba45b792cf46055.tar.bz2
Issue #13415: test_curses skips unencodable characters
Diffstat (limited to 'Lib/test/test_curses.py')
-rw-r--r--Lib/test/test_curses.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py
index ce09855..21ac608 100644
--- a/Lib/test/test_curses.py
+++ b/Lib/test/test_curses.py
@@ -267,11 +267,18 @@ def test_issue6243(stdscr):
def test_unget_wch(stdscr):
if not hasattr(curses, 'unget_wch'):
return
+ import locale
+ encoding = locale.getpreferredencoding()
for ch in ('a', '\xe9', '\u20ac', '\U0010FFFF'):
try:
+ ch.encode(encoding)
+ except UnicodeEncodeError:
+ continue
+ try:
curses.unget_wch(ch)
except Exception as err:
- raise Exception("unget_wch(%a) failed: %s" % (ch, err))
+ raise Exception("unget_wch(%a) failed with locale encoding %s: %s"
+ % (ch, encoding, err))
read = stdscr.get_wch()
read = chr(read)
if read != ch: