[sugar] Re: dbus python bindings and {}

John J5 Palmieri johnp
Tue Jul 25 19:51:00 EDT 2006


It needs to know the type of the dict there are a couple of ways to do
that either by using the dbus.Dict type or just sending in the
signature.  Introspection should also work.

On Sat, 2006-07-22 at 22:22 -0500, Dan Williams wrote:
> John,
> 
> Seems there's an error in the dbus python bindings?  I'm not sure I
> really know what's going on here, but:
> 
> import dbus
> 
> _PRESENCE_SERVICE = "org.laptop.Presence"
> _PRESENCE_DBUS_INTERFACE = "org.laptop.Presence"
> _PRESENCE_OBJECT_PATH = "/org/laptop/Presence"
> 
> bus = dbus.SessionBus()
> ps = dbus.Interface(bus.get_object(_PRESENCE_SERVICE,
> 		_PRESENCE_OBJECT_PATH), _PRESENCE_DBUS_INTERFACE)
> 
> ps.registerService({})
> 
> returns the error:
> 
> Traceback (most recent call last):
>   File "foobar", line 11, in ?
>     ps.registerService({})
>   File "/usr/lib/python2.4/site-packages/dbus/proxies.py", line 25, in __call__
>     ret = self._proxy_method (*args, **keywords)
>   File "/usr/lib/python2.4/site-packages/dbus/proxies.py", line 96, in __call__
>     iter.append(arg)
>   File "dbus_bindings.pyx", line 1077, in dbus_bindings.MessageIter.append
>   File "dbus_bindings.pyx", line 1213, in dbus_bindings.MessageIter.append_dict
> IndexError: list index out of range
> 
> If you instead use {1:1} or otherwise use a non-empty dict, it works
> correctly...  I thought dbus could handle empty dicts, just like it can
> handle empty arrays.  Perhaps I'm wrong.
> 
> dbus-python-0.62-1
> 
> Is this maybe fixed in 0.90 bindings?
> 
> Dan
> 



More information about the Sugar-devel mailing list