You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
According to the dbus specification, the interface header can be omitted in method calls. If you do that, then this trace results:
ERROR Unexpected error processing message: %s
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/dbus_fast/aio/message_reader.py", line 23, in _message_reader
process(message)
File "/usr/lib/python3.8/site-packages/dbus_fast/message_bus.py", line 847, in _process_message
handler = self._find_message_handler(msg)
File "/usr/lib/python3.8/site-packages/dbus_fast/message_bus.py", line 918, in _find_message_handler
if "org.freedesktop.DBus." in msg.interface:
TypeError: argument of type 'NoneType' is not iterable
Call method with no interface. For this I used the old python-dbus package, since this is also where my bug is coming from: Old code using that package.
Possible fix
This fixes it for me, but I didn't have time to really absorb your whole test/pre-commit framework. I also don't know if this affects performance disproportionately.
diff --git a/src/dbus_fast/message_bus.py b/src/dbus_fast/message_bus.py
index 14776fb..aa9a7d5 100644
--- a/src/dbus_fast/message_bus.py
+++ b/src/dbus_fast/message_bus.py
@@ -915,7 +915,7 @@ class BaseMessageBus:
def _find_message_handler(
self, msg: _Message
) -> Optional[Callable[[Message, Callable[[Message], None]], None]]:
- if "org.freedesktop.DBus." in msg.interface:
+ if msg.interface is not None and "org.freedesktop.DBus." in msg.interface:
if (
msg.interface == "org.freedesktop.DBus.Introspectable"
and msg.member == "Introspect"
@@ -949,7 +949,10 @@ class BaseMessageBus:
if method.disabled:
continue
- if (
+ if msg.interface is None and (
+ msg.member == method.name
+ and msg.signature == method.in_signature) \
+ or (
msg.interface == interface.name
and msg.member == method.name
and msg.signature == method.in_signature
The text was updated successfully, but these errors were encountered:
Describe the bug
According to the dbus specification, the interface header can be omitted in method calls. If you do that, then this trace results:
This is the same bug I logged against dbus_next.
To Reproduce
Run example service
Call method with no interface. For this I used the old python-dbus package, since this is also where my bug is coming from: Old code using that package.
Possible fix
This fixes it for me, but I didn't have time to really absorb your whole test/pre-commit framework. I also don't know if this affects performance disproportionately.
The text was updated successfully, but these errors were encountered: