Unicode string.
This is an incompatible change, but the previous behaviour was completly wrong.
Instantiate the string *str* with the supplied parameters, where *str* should
be a parameterized string obtained from the terminfo database. E.g.
- ``tparm(tigetstr("cup"), 5, 3)`` could result in ``'\033[6;4H'``, the exact
+ ``tparm(tigetstr("cup"), 5, 3)`` could result in ``b'\033[6;4H'``, the exact
result depending on terminal type.
curses.tigetflag('hc')
curses.tigetnum('co')
curses.tigetstr('cr')
- curses.tparm('cr')
+ curses.tparm(b'cr')
curses.typeahead(sys.__stdin__.fileno())
curses.unctrl('a')
curses.ungetch('a')
curses.ungetch(1025)
stdscr.getkey()
+def test_issue10570():
+ b = curses.tparm(curses.tigetstr("cup"), 5, 3)
+ assert type(b) is bytes
+
def main(stdscr):
curses.savetty()
try:
test_userptr_without_set(stdscr)
test_resize_term(stdscr)
test_issue6243(stdscr)
+ test_issue10570()
finally:
curses.resetty()
Library
-------
+- Issue #10570: curses.tigetstr() is now expecting a byte string, instead of
+ a Unicode string.
+
- Issue #2892: preserve iterparse events in case of SyntaxError.
- Issue #670664: Fix HTMLParser to correctly handle the content of
PyCursesSetupTermCalled;
- if (!PyArg_ParseTuple(args, "s|iiiiiiiii:tparm",
+ if (!PyArg_ParseTuple(args, "y|iiiiiiiii:tparm",
&fmt, &i1, &i2, &i3, &i4,
&i5, &i6, &i7, &i8, &i9)) {
return NULL;