Zeitgeist.client fails on systems with newer Python due to 'inspect' module change
I have zeitgeist 1.0.4 installed on Fedora 37, which has Python 3.11. When I try to start GNOME Activity Journal, the app fails with the following backtrace:
client.py:1100:<module>:AttributeError: module 'inspect' has no attribute 'getargspec'
Traceback (most recent call last):
File "/usr/bin/gnome-activity-journal", line 130, in <module>
check_zeitgeist_version()
File "/usr/bin/gnome-activity-journal", line 53, in check_zeitgeist_version
from src.external import CLIENT, CLIENT_VERSION
File "/usr/share/gnome-activity-journal/src/external.py", line 30, in <module>
from zeitgeist.client import ZeitgeistClient
File "/usr/lib/python3.11/site-packages/zeitgeist/client.py", line 1100, in <module>
_FIND_EVENTS_FOR_TEMPLATES_ARGS = inspect.getargspec(
^^^^^^^^^^^^^^^^^^
AttributeError: module 'inspect' has no attribute 'getargspec'
This seems to be related to a known issue with the inspect
module for Python versions 3.10 and later (see e.g. this issue, ref. Python 3.11.1 documentation).
The client.py
file seems pretty self contained, so I think I can write a patch myself. If zeitgeist always expects Python 3 then it seems like a straightforward switch from getargspec
to getfullargspec
, otherwise a straightforward check to use the appropriate function.