[PyKDE] Re: dcop

Phil Thompson phil at riverbankcomputing.co.uk
Thu May 27 18:45:01 BST 2004


On Thursday 27 May 2004 5:33 pm, Stefan Bund wrote:
> Stefan Bund <l-pykde.z.xalan at xoxy.net> writes:
> > I have however a Problem in my PyDCOP.DCOPClient implementation. I get
> > a "SystemError: ../Objects/classobject.c:518: bad argument to internal
> > function" when calling DCOPClient::call from python:
>
> After thinking about it a little, I started dissecting the source. I
> found classobject.c in the python2.3 source. The above mentioned line
> is in PyInstance_NewRaw. This is happily only called from very few
> places. Looking at siplib, the only place this can be called from
> (indirectly) seems to be sipNewCppToSelf.
>
> Ok. At the other end, I looked at the generated code for
> DCOPClient::call in dcop/dcoppart0.cpp. Here I find the call
>
>     return sipBuildResult(0,"(bPP)",sipRes,a4,a5);
>
> looking up sipBuildResult and from there going to buildObject, I find
> the following code handling the 'P' conversion:
>
>     case 'P':
>             {
>                     void *sipCpp = va_arg(va,void *);
>                     PyObject *cls = va_arg(va,PyObject *);
>
>                     el =
> sipNewCppToSelf(sipCpp,cls,SIP_PY_OWNED|SIP_SIMPLE); }
>
>             break;
>
> With this in mind, the sipBuildResult call looks pretty fishy to
> me. As I read it, it should be
>
>     return
> sipBuildResult(0,"(bPP)",sipRes,a4,sipClass_QCString,a5,sipClass_QByteArray
>);
>
> so I manually patched dcoppart0.cpp with above code and voila,
> everything working now. I have however *no* knowledge of sip and don't
> know, how to really fix this, since dcoppart0.cpp is generated from
> sip.
>
> I hope this helps,
>
> Stefan.

What version of SIP are you using? This should be fixed in v3.10.2/4.0rc4.

Phil




More information about the PyQt mailing list