_closed_callback function causes traces
I don’t know exactly if this is an actual issue of pynotify2 of a new wired behaviour of my dbus (debian bullseye). The first calls (and callbacks aswell) work as expected, then KeyError exceptions from function _closed_callback start to show up.
After placing some debug lines, i realized, that those callbacks causing the exeptions are actually not from ‘my own’ notifications, but from other ones randomly showing up. So when these signals come in, there is naturally no key in the registry.
I don’t know if we should get signals for all callbacks, or just the ones for the notifications we created ourself. If this dbus behaviour is correct, these exception should be caught and ignored.
def _closed_callback(nid, reason):
nid, reason = int(nid), int(reason)
+ try:
- n = notifications_registry[nid]
+ n = notifications_registry[nid]
+ except KeyError:
+ return
n._closed_callback(n)
del notifications_registry[nid]
The same is probably true for the action_callback above, as the other callbacks i got, didn’t had callbacks, nothing happend there, but I imagine, that the same issue might be preset there aswell.
Comments (1)
-
repo owner - Log in to comment
Hi! It looks like this was fixed some years ago, but no-one has packaged the update for Debian. See commit d4482e7169e3e9787d602d78f55c0cd74d805ff6 .
pynotify2 is kind of deprecated (/abandoned) in any case. I’ve listed some alternatives in the README.