[Pyrex] Re: Re: pyCdk SystemError: Objects/longobject.c:240: bad argument to internal function

forestiero at qwest.net forestiero at qwest.net
Wed Mar 9 07:27:17 CET 2005


Greg Ewing wrote:

> DogWalker wrote:
> 
>> Searching the cdk.c file, I get no hit on "PyInt_AsUnsignedLongMask".
>> That failure leads me to believe that the fix had no effect.
> 
> In that case I may have jumped to the wrong conclusion
> about the cause of the problem. The symptoms seemed to
> match an already known problem, but in your case it
> might be something different.
> 
> Can you send the details again? I'll have a closer look.
> 

I don't think it is a pyrex problem. The problem is that many CDK function
parameters are of chtype: which is typedef'd as unsigned long. Application
code, such as the pyCdk examples use python objects like curses.A_BOLD as
values for chtype parameters. But curses.A_BOLD (et al) are python ints. At
sometime, I suppose, python was more generous when given an int when a long
is expected, otherwise pyCdk examples could never have ran.  I can change
the cdk.pyx code to convert all chtype parameters to long before calling
the cdk function. (The "problem" with the "parse error" came, I think, from
having two versions of cdk. One had CDKBUTTON the other not. The one that
had CDKBUTTON was used to build the library, but the pyCdk setup.py pointed
to the cdk version without CDKBUTTON.)




More information about the Pyrex mailing list