New submission from Robin Bryce:

curses.filter forces the top most window to 1 line tall and preserves
existing tty content. It must be called *before* curses.initscr in order
to acheive this.

The python documentation states that curses.filter must be called before
initscr but the implementation prevents this. It uses the
NoArgNoReturnVoidFunction macro defined in Include/py_curses.h. This
macro in turn invokes the PyCursesInitialised macro which forces an
error if initscr has not been called.

curses.filter needs an explicit definition to avoid this:

Replacing "NoArgNoReturnVoidFunction(filter)" in Modules/_cursesmodule.c
with

static PyObject *PyCurses_filter (PyObject *self)
{
  /* MUST NOT BE PyCursesInitialised */
  filter(); \
  Py_INCREF(Py_None);
  return Py_None;
}

Would allow curses.filter to be called as documented. But really should
get a check for "!PyCursesInitialised".

----------
components: Documentation, Library (Lib)
messages: 61708
nosy: robinbryce
severity: normal
status: open
title: curses.filter can not be used as described in its documentation
type: behavior
versions: Python 2.5

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1940>
__________________________________
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to