2.3/2.4 library docs indicate the following for the
curses window object methods 'overlay' and 'overwrite':
"To get fine-grained control over the copied region,
the second form of overwrite() can be used. sminrow and
smincol are the upper-left coordinates of the source
window, the other variables mark a rectangle in the
destination window."
[syntax: overlay(destwin[, sminrow, smincol, dminrow,
dmincol, dmaxrow, dmaxcol])]
However, attempting to use the 7 arg form of either
overlay or overwrite results in a TypeError being raised.
Inspection of the PyCursesWindow_Overlay and
PyCursesWindow_Overwrite functions from _cursesmodule.c
reveals an incorrect format for the 7-arg specific call
to PyArg_ParseTuple, such that a single argument tuple
is expected which would contain the method arguments.
Obviously, this is incompatible with the general
argument length conditional used to decide which
PyArg_ParseTuple will be used.
The bug has only been verified on python 2.3.5, not
2.4, however a cursory examination of 2.4 code reveals
no differences in these functions.
The attached patch alters the PyArg_ParseTuple format
string for both functions such that seven arguments are
parsed as expected and the related copywin() code is
thus executed.
|