altdesktop / python-dbus-next

🚌 The next great DBus library for Python with asyncio support
https://python-dbus-next.readthedocs.io/en/latest/
MIT License
187 stars 58 forks source link

Make interface header optional on method calls #163

Open izak opened 3 weeks ago

izak commented 3 weeks ago

When migrating some code from dbus-python, I ran into this exception:

dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: None.GetValue with signature "" could not be found

It turns out that the other end is calling a method without specifying the interface. While this can be worked around by fixing the other end and always specifying an interface, it should be trivial to adapt the _matches method of a message, probably here, to ignore the interface if it is None.

izak commented 3 weeks ago

I went about fixing it slightly differently, more explicitly calling _matches from the message_bus module without an interface when it is None.