[Twisted-Python] ANN: Twisted DBus 1.0

Tom Cocagne tom.cocagne at gmail.com
Tue Jul 3 16:36:41 EDT 2012

Nevermind. Simply removing the explicit credential passing from the
client side of the implementation fixed the problem. txdbus 1.0.2
appears to run just fine on 12.1.


On Tue, Jul 3, 2012 at 10:14 AM, Tom Cocagne <tom.cocagne at gmail.com> wrote:
> Unfortunately, it looks like 12.1 may be completely incompatible with
> txdbus. The ancillary data support for Unix sockets appears to support
> only file descriptor passing and breaks when credential passing is
> attempted. The current implementation assumes and fails to check for
> ancillary data sizes other than 4 (credentials are of length 12). I
> believe it will be a relatively straight-forward task to add
> credential passing support similar to how file descriptor passing is
> done but it'll probably have to wait until the next Twisted release. A
> straight-forward work-around eludes me.
> Tom
> On Tue, Jul 3, 2012 at 8:16 AM, Tom Cocagne <tom.cocagne at gmail.com> wrote:
>> I believe credential passing over Unix sockets is a new feature in
>> Twisted 12.1. The older versions I used to develop this project didn't
>> support that feature so I had to implement it myself. From the
>> stacktrace, I'm guessing that my workaround for this is clashing with
>> Twisted's new build-in support. I'll try and take a look at this in
>> the near future.
>> Tom
>> On Tue, Jul 3, 2012 at 5:27 AM, Tobias Oberstein
>> <tobias.oberstein at tavendo.de> wrote:
>>>> For anyone interested in taking a look, I've just released a native-Python
>>>> implementation of the DBus protocol for Twisted. The intent of the
>>>> implementation is to provide Twisted applications with a full-featured DBus API
>>>> that is consistent with the rest of the framework and does not require the use
>>>> of the glib reactor or libdbus Python bindings.
>>> Cool! Also great work on the examples, tutorial and protocol overview!
>>> I'm having problems with the desktop notification example though .. any hints?
>>> oberstet at ubuntu10bld_klon0:~/scm/twisted_dbus/doc/tutorial_examples$ ~/python273/bin/python -V
>>> Python 2.7.3
>>> oberstet at ubuntu10bld_klon0:~/scm/twisted_dbus/doc/tutorial_examples$ uname -a
>>> Linux ubuntu10bld_klon0 2.6.32-41-generic #91-Ubuntu SMP Wed Jun 13 11:44:43 UTC 2012 i686 GNU/Linux
>>> oberstet at ubuntu10bld_klon0:~/scm/twisted_dbus/doc/tutorial_examples$ ~/python273/bin/python desktop_noficiation
>>> Unhandled Error
>>> Traceback (most recent call last):
>>>   File "/home/oberstet/python273/lib/python2.7/site-packages/twisted/python/log.py", line 84, in callWithLogger
>>>     return callWithContext({"system": lp}, func, *args, **kw)
>>>   File "/home/oberstet/python273/lib/python2.7/site-packages/twisted/python/log.py", line 69, in callWithContext
>>>     return context.call({ILogContext: newCtx}, func, *args, **kw)
>>>   File "/home/oberstet/python273/lib/python2.7/site-packages/twisted/python/context.py", line 118, in callWithContext
>>>     return self.currentContext().callWithContext(ctx, func, *args, **kw)
>>>   File "/home/oberstet/python273/lib/python2.7/site-packages/twisted/python/context.py", line 81, in callWithContext
>>>     return func(*args,**kw)
>>> --- <exception caught here> ---
>>>   File "/home/oberstet/python273/lib/python2.7/site-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
>>>     why = selectable.doRead()
>>>   File "/home/oberstet/python273/lib/python2.7/site-packages/twisted/internet/unix.py", line 169, in doRead
>>>     fd = struct.unpack('i', ancillary[0][2])[0]
>>> struct.error: unpack requires a string argument of length 4
>>> This is on Twisted 12.1
>>> _______________________________________________
>>> Twisted-Python mailing list
>>> Twisted-Python at twistedmatrix.com
>>> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

More information about the Twisted-Python mailing list