diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-11-03 20:36:55 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-11-03 20:36:55 +0100 |
commit | 65f51bb1502aad75850c8b66db98d1359314c5d7 (patch) | |
tree | 36defcada99055e83f86dc2d825e86e8fce5d45d | |
parent | 6fc41dd1e34a25298f867110a0f408b2d27e2a3f (diff) | |
parent | b3bc7e764db4327953aaaf1316e0edc0ff6b16fb (diff) | |
download | cpython-git-65f51bb1502aad75850c8b66db98d1359314c5d7.tar.gz |
(Merge 3.2) Issue #10570: curses.putp() is now expecting a byte string, instead
of a Unicode string.
This is an incompatible change, but putp() is used to emit terminfo commands,
which are bytes strings, not Unicode strings.
-rw-r--r-- | Lib/test/test_curses.py | 3 | ||||
-rw-r--r-- | Misc/NEWS | 4 | ||||
-rw-r--r-- | Modules/_cursesmodule.c | 3 |
3 files changed, 6 insertions, 4 deletions
diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py index ccbbc23433..72be3e7b51 100644 --- a/Lib/test/test_curses.py +++ b/Lib/test/test_curses.py @@ -183,7 +183,7 @@ def module_funcs(stdscr): win = curses.newwin(5,5) win = curses.newwin(5,5, 1,1) curses.nl() ; curses.nl(1) - curses.putp('abc') + curses.putp(b'abc') curses.qiflush() curses.raw() ; curses.raw(1) curses.setsyx(5,5) @@ -283,6 +283,7 @@ def test_unget_wch(stdscr): def test_issue10570(): b = curses.tparm(curses.tigetstr("cup"), 5, 3) assert type(b) is bytes + curses.putp(b) def main(stdscr): curses.savetty() @@ -353,8 +353,8 @@ Library - Byte compilation in packaging is now isolated from the calling Python -B or -O options, instead of being disallowed under -B or buggy under -O. -- Issue #10570: curses.tigetstr() is now expecting a byte string, instead of - a Unicode string. +- Issue #10570: curses.putp() and curses.tigetstr() are now expecting a byte + string, instead of a Unicode string. - Issue #13295: http.server now produces valid HTML 4.01 strict. diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index cc42f4b824..cfa5b7a571 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -2418,7 +2418,8 @@ PyCurses_Putp(PyObject *self, PyObject *args) { char *str; - if (!PyArg_ParseTuple(args,"s;str", &str)) return NULL; + if (!PyArg_ParseTuple(args,"y;str", &str)) + return NULL; return PyCursesCheckERR(putp(str), "putp"); } |