New issue 1823: curses module noutrefresh call fails when called on a pad
object in pypy 2.3.1
https://bitbucket.org/pypy/pypy/issue/1823/curses-module-noutrefresh-call-fails-when
Tapani Kiiskinen:
I'm doing a noutrefresh call on a pad which i've instanciated with
curses.newpad:
pad.noutrefresh(0, 0, y, x, y + rows - 1, x + cols - 1)
which fails with error:
File "/home/tappi/programs/pypy-2.3.1-linux64/lib_pypy/_curses.py", line
840, in noutrefresh
return _check_ERR(lib.wnoutrefresh(self._win, *args),
TypeError: 'int(*)(WINDOW *)' expects 1 arguments, got 7
I checked the _curses.py file and lib._m_ispad(self.win) returns false which
results in wnoutrefresh being called instead of pnoutrefresh, where
pnoutrefresh would be the right one to call when using pads.
The definition of _m_ispad depends on the existence of WINDOW_HAS_FLAGS
definition:
int _m_ispad(WINDOW *win) {
#if defined WINDOW_HAS_FLAGS
return (win->_flags & _ISPAD);
#else
return 0;
#endif
}
If I hack this piece of code to not check for WINDOW_HAS_FLAGS my code works.
Supposedly that variable should be defined somewhere but it's not being defined.
Context: the same code works with cpython.
I'm running an ubuntu 13.10
PyPy version:
Python 2.7.6 (32f35069a16d, Jun 06 2014, 11:20:40)
[PyPy 2.3.1 with GCC 4.6.3] on linux2
_______________________________________________
pypy-issue mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-issue