Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method “ListInhibitions” returned type “(a(ss))”, but expected “(a{ss})” #127

Open
credomane opened this issue Apr 27, 2024 · 0 comments

Comments

@credomane
Copy link

I'm sure I'm doing something wrong but I can't figure it out. Is there some way for me to override the "expected" return type that I'm overlooking?

I'm on Arch Linux with dasbus installed through pacman.

This is my script

from dasbus.connection import SessionMessageBus
from dasbus.unix import GLibClientUnix
bus = SessionMessageBus()

#dbus-send --print-reply --dest=org.kde.Solid.PowerManagement.PolicyAgent /org/kde/Solid/PowerManagement/PolicyAgent org.kde.Solid.PowerManagement.PolicyAgent.ListInhibitions

proxy = bus.get_proxy(
    "org.kde.Solid.PowerManagement.PolicyAgent",
    "/org/kde/Solid/PowerManagement/PolicyAgent")

print(proxy.ListInhibitions())

I'm expecting to get a printout something like what dbus-send returns (my KDE dbus command is in the python file)

method return time=1714249844.635597 sender=:1.24 -> destination=:1.202 serial=1028 reply_serial=2
   array [
      struct {
         string "Steam"
         string "Client interface"
      }
   ]

Instead I'm getting this error:

Traceback (most recent call last):
  File "./main.py", line 12, in <module>
    print(proxy.ListInhibitions())
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/dasbus/client/handler.py", line 450, in _call_method
    return self._get_method_reply(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/dasbus/client/handler.py", line 483, in _get_method_reply
    return self._handle_method_error(error)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/dasbus/client/handler.py", line 518, in _handle_method_error
    raise error
  File "/usr/lib/python3.12/site-packages/dasbus/client/handler.py", line 480, in _get_method_reply
    result = call(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/dasbus/client/handler.py", line 57, in sync_call
    return connection.call_sync(
           ^^^^^^^^^^^^^^^^^^^^^
gi.repository.GLib.GError: g-io-error-quark: Method “ListInhibitions” returned type “(a(ss))”, but expected “(a{ss})” (13)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant