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 59 forks source link

Allow for signature mismatch when processing signals? #96

Open glmck13 opened 2 years ago

glmck13 commented 2 years ago

Hi – I’m developing an app that interfaces with the Pidgin IM/chat client over Dbus. When I try to listen to the ReceivedImMsg signal, I get the following WARNING message, and my signal handler fails to be invoked:

WARNING:root:got signal "im.pidgin.purple.PurpleInterface.ReceivedImMsg" with unexpected signature "issiu"

Looking at the code, I noticed a ‘return’ statement in proxy_object.py if a signature mismatch is detected. If I comment this out, everything works as expected. Is there a reason for the ‘return’? Can it be safely removed? Thanks!

acrisci commented 2 years ago

If the service you are interacting with is giving you issiu then put that as the expected signature in your introspection xml used to make the proxy object. Overloading methods with multiple signatures is not supported by this library. Although I believe some libraries extend the type system for wildcard types which might be ok but needs some research.

Type guarantees are an important part of this library and removing the type checks would be a breaking change.