From: Victor Stinner Date: Wed, 2 Nov 2011 22:47:58 +0000 (+0100) Subject: (Merge 3.2) Issue #10570: curses.tigetstr() is now expecting a byte string, X-Git-Tag: v3.3.0a1~969 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=df5bccc8a3adfe79e93bbc62bc24b3a95d57b3ac;p=python (Merge 3.2) Issue #10570: curses.tigetstr() is now expecting a byte string, instead of a Unicode string. This is an incompatible change, but the previous behaviour was completly wrong. --- df5bccc8a3adfe79e93bbc62bc24b3a95d57b3ac diff --cc Lib/test/test_curses.py index b4673e9863,09807834b4..ccbbc23433 --- a/Lib/test/test_curses.py +++ b/Lib/test/test_curses.py @@@ -264,22 -264,10 +264,26 @@@ def test_issue6243(stdscr) curses.ungetch(1025) stdscr.getkey() +def test_unget_wch(stdscr): + if not hasattr(curses, 'unget_wch'): + return + ch = 'a' + curses.unget_wch(ch) + read = stdscr.get_wch() + read = chr(read) + if read != ch: + raise AssertionError("%r != %r" % (read, ch)) + + ch = ord('a') + curses.unget_wch(ch) + read = stdscr.get_wch() + if read != ch: + raise AssertionError("%r != %r" % (read, ch)) + + def test_issue10570(): + b = curses.tparm(curses.tigetstr("cup"), 5, 3) + assert type(b) is bytes + def main(stdscr): curses.savetty() try: @@@ -288,7 -276,7 +292,8 @@@ test_userptr_without_set(stdscr) test_resize_term(stdscr) test_issue6243(stdscr) + test_unget_wch(stdscr) + test_issue10570() finally: curses.resetty() diff --cc Misc/NEWS index c751ba689c,993dfaec45..11f98a7f47 --- a/Misc/NEWS +++ b/Misc/NEWS @@@ -350,13 -66,11 +350,16 @@@ Core and Builtin Library ------- + - Issue #10570: curses.tigetstr() is now expecting a byte string, instead of + a Unicode string. + +- Issue #13295: http.server now produces valid HTML 4.01 strict. + - Issue #2892: preserve iterparse events in case of SyntaxError. +- Issue #13287: urllib.request and urllib.error now contains a __all__ and + exposes only relevant Classes, Functions. Patch by Florent Xicluna. + - Issue #670664: Fix HTMLParser to correctly handle the content of ```` and ````.