Commit b588e731 authored by Victor Stinner's avatar Victor Stinner

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.
parent bfbae77c
...@@ -183,7 +183,7 @@ def module_funcs(stdscr): ...@@ -183,7 +183,7 @@ def module_funcs(stdscr):
win = curses.newwin(5,5) win = curses.newwin(5,5)
win = curses.newwin(5,5, 1,1) win = curses.newwin(5,5, 1,1)
curses.nl() ; curses.nl(1) curses.nl() ; curses.nl(1)
curses.putp('abc') curses.putp(b'abc')
curses.qiflush() curses.qiflush()
curses.raw() ; curses.raw(1) curses.raw() ; curses.raw(1)
curses.setsyx(5,5) curses.setsyx(5,5)
...@@ -267,6 +267,7 @@ def test_issue6243(stdscr): ...@@ -267,6 +267,7 @@ def test_issue6243(stdscr):
def test_issue10570(): def test_issue10570():
b = curses.tparm(curses.tigetstr("cup"), 5, 3) b = curses.tparm(curses.tigetstr("cup"), 5, 3)
assert type(b) is bytes assert type(b) is bytes
curses.putp(b)
def main(stdscr): def main(stdscr):
curses.savetty() curses.savetty()
......
...@@ -66,8 +66,8 @@ Core and Builtins ...@@ -66,8 +66,8 @@ Core and Builtins
Library Library
------- -------
- Issue #10570: curses.tigetstr() is now expecting a byte string, instead of - Issue #10570: curses.putp() and curses.tigetstr() are now expecting a byte
a Unicode string. string, instead of a Unicode string.
- Issue #2892: preserve iterparse events in case of SyntaxError. - Issue #2892: preserve iterparse events in case of SyntaxError.
......
...@@ -2379,7 +2379,8 @@ PyCurses_Putp(PyObject *self, PyObject *args) ...@@ -2379,7 +2379,8 @@ PyCurses_Putp(PyObject *self, PyObject *args)
{ {
char *str; 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"); return PyCursesCheckERR(putp(str), "putp");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment