[PyKDE] Re: dcop

Stefan Bund l-pykde.z.xalan at xoxy.net
Thu May 27 15:35:00 BST 2004

Jim Bublitz <jbublitz at nwinternet.com> writes:
> I haven't looked at the DCOPObject stuff very much, but it shouldn't be too 
> much of a problem (famous last words). Marshalling/demarshalling is the hard 
> part - very ugly in Python, very easy in C++.
> You can use Python strings as QByteArrays, but much beyond a single int or a 
> real char string that's pretty difficult.

Inspired by this thread, I revisited an old pyqt application and
implemented a simple PyDCOP module to support DCOP clients and servers
from python in a nice and straight forward way. Till now, I have
implemented marshaling of int's and QStrings, but other types should
not be to hard. I think, I'll at least implement QStringList, as thats
used quite often. 

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:

        (rv, replyType, replyData) = \
             self._client.call(self._appid, self._object, id, data)

(self._client is a dcop.DCOPClient instance ...) The call is
successfully transfered (that is, the remote app receives and
correctly handles the request), but probably while processing the
return value, I get this error. This is using sip 3.10.2, pyqt 3.11
and PyKDE 3.11rc1 (sip and pyqt installed from debian unstable

I don't have any clue, what this is about and would appreciate any


PS: It would be much nicer to just have access to the Qt QDataStream
stream operators under python instead of re-implementing the streaming
in pure python. It would suffice, to just map all the '<<' and
'>>' operators to some 'read_<type>' and 'write_<type>'
functions, I even tried that as a quick hack in an old pykde
version. Worked flawlessly: s = QDataStream(a); i =
s.read_int(); q = s.read_QString() ...

-- received off-list at that address will be *silently* and
-- *unconditionally* dropped. You can attribute this inconvenience to
-- the proliferation of spammers on the Internet. I hope, you can
-- understand my position and accept my counter measures.

More information about the PyQt mailing list