Comment 12 for bug 1008898

Revision history for this message
In , Simon McVittie (smcv) wrote :

OK, so this is actually a combination of two things.

(In reply to comment #3)
> For D-Bus calls to be reliable, you should specify an interface (use
> dbus_interface=... in the call, or call the method via a dbus.Interface
> wrapper).

Because you didn't do this, dbus-python couldn't correlate the signature of the method with the signature in the Introspect() result, and had to guess what you meant. Normally that'd be OK, because you used ObjectPath as a hint that you thought the service would expect object paths.

However, the signature-guessing function in dbus-python was broken for ObjectPath and Signature objects under Python 3, because those objects have changed from a subtype of the old meaning of str (= bytes) in Python 2, to a subtype of the new meaning of str (= unicode) in Python 3. I've fixed that in git, I'll attach a patch here.

The precedence is:

* using dbus.SomeType (lowest)
* Introspect() result
* signature="..." (highest)

If dbus-python wasn't constrained by backwards-compatibility, the signature would be required (like it is in GDBus), but unfortunately that's not really an option.