Bug#1117444: Cannot run: TypeError by GioUnix.DesktopAppInfo.get_filename() in gtweak/utils.py
Simon McVittie
smcv at debian.org
Sun Oct 5 20:35:12 BST 2025
Control: reassign -1 python3-gi 3.50.0-7
Control: retitle -1 pygobject: GioUnix.DesktopAppInfo requires extraneous parameter to get_filename() when using GLib 2.84.x
Control: affects -1 + gnome-tweaks
Here is a minimal reproducer for the bug. You need python3-gi and at
least one .desktop file: "apt install python3-gi xterm" is sufficient.
> $ python3
> >>> from gi.repository import Gio
> >>> Gio.app_info_get_all()[0].get_filename()
This works fine with GLib 2.86 from experimental: it tells me the
filename of one of my .desktop files. However, the same fails with GLib
2.84 from testing/unstable:
> $ python3
> >>> from gi.repository import Gio
> >>> Gio.app_info_get_all()[0].get_filename()
> Traceback (most recent call last):
> File "<python-input-2>", line 1, in <module>
> Gio.app_info_get_all()[0].get_filename()
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
> TypeError: GioUnix.DesktopAppInfo.get_filename() takes exactly 1 argument (0 given)
I think this is a regression in pygobject caused by the patches that
were added to make it forward-compatible with GLib 2.86. Unfortunately
it seems that at least one of those changes is not fully
backward-compatible with GLib 2.84.
One way to resolve this would be if the release team give the go-ahead
to do the GLib 2.86 transition; the other way would be to revert or
improve the pygobject changes (and if they are reverted for now, reapply
them as part of the GLib 2.86 transition).
I am confident that the proposed patch to gnome-tweaks is *not* a valid
solution, because it would introduce the opposite regression when used
with both the new pygobject and the new GLib:
> $ python3
> >>> from gi.repository import Gio
> >>> app = Gio.app_info_get_all()[0]
> >>> app.get_filename()
> '/usr/share/applications/io.github.fabiangreffrath.Hexen.desktop'
> >>> app.get_filename(app)
> Traceback (most recent call last):
> File "<python-input-3>", line 1, in <module>
> app.get_filename(app)
> ~~~~~~~~~~~~~~~~^^^^^
> TypeError: GioUnix.DesktopAppInfo.get_filename() takes exactly 1 argument (2 given)
Instead, I think this needs to be fixed in pygobject.
smcv
More information about the pkg-gnome-maintainers
mailing list