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

Python dbus error on Linux when sending notification #658

Closed
Dev3XOR opened this issue Dec 20, 2021 · 1 comment
Closed

Python dbus error on Linux when sending notification #658

Dev3XOR opened this issue Dec 20, 2021 · 1 comment

Comments

@Dev3XOR
Copy link

Dev3XOR commented Dec 20, 2021

I use plyer in virtual environment. Whenever I call notification.notify I get a warning:

UserWarning: The Python dbus package is not installed.
Try installing it with your distribution's package manager, it is usually called python-dbus or python3-dbus, but you might have to try dbus-python instead, e.g. when using pip.
  warnings.warn(msg)

I can see notification works though.
Now when I've tried to install dbus-python notifictions refused to work at all and I get this error:

ERROR:dbus.connection:Unable to set arguments ('', 0, None, "Time's Up!", 'Your timer has reached 0', [], [], 20000) according to signature 'susssasa{sv}i': <class 'TypeError'>: Expected a string or unicode object
Exception in thread Thread-60:
Traceback (most recent call last):
  File "~/.pyenv/versions/3.10.0/lib/python3.10/threading.py", line 1009, in _bootstrap_inner
    self.run()
  File "~/.pyenv/versions/3.10.0/lib/python3.10/threading.py", line 1358, in run
    self.function(*self.args, **self.kwargs)
  File "~/Projekty/pomodoro/src/pomodoro/__init__.py", line 40, in func_wrapper
    self.on_ready()
  File "~/Projekty/pomodoro/src/pomodoro/__init__.py", line 139, in clock_ready
    notification.notify(
  File "~/.virtualenvs/pomodoro/lib/python3.10/site-packages/plyer/facades/notification.py", line 79, in notify
    self._notify(
  File "~/.virtualenvs/pomodoro/lib/python3.10/site-packages/plyer/platforms/linux/notification.py", line 46, in _notify
    interface.Notify(
  File "~/.virtualenvs/pomodoro/lib/python3.10/site-packages/dbus/proxies.py", line 72, in __call__
    return self._proxy_method(*args, **keywords)
  File "~/.virtualenvs/pomodoro/lib/python3.10/site-packages/dbus/proxies.py", line 141, in __call__
    return self._connection.call_blocking(self._named_service,
  File "~/.virtualenvs/pomodoro/lib/python3.10/site-packages/dbus/connection.py", line 643, in call_blocking
    message.append(signature=signature, *args)
TypeError: Expected a string or unicode object

The same occures when I try to run program outside of virtualenv (python3-dbus is installed globaly on my machine).

@Dev3XOR
Copy link
Author

Dev3XOR commented Dec 21, 2021

OK, silly me. Solution was simple. The problem was that app_icon was set to None which works without dbus, but throws error when it's present. Sorry for the mess.

@Dev3XOR Dev3XOR closed this as completed Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant