gnome-tweaks crashed with TypeError in __init__(): Gtk.Image.new_from_icon_name() takes exactly 1 argument (2 given)

Bug #2056657 reported by Roman
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNOME Tweaks
Fix Released
Unknown
gnome-tweaks (Ubuntu)
Fix Released
High
Unassigned

Bug Description

gnome-tweaks crashes on launch after updating to 46-beta
May it depend on some new GTK version which is not yet released for 24.04?

ProblemType: Crash
DistroRelease: Ubuntu 24.04
Package: gnome-tweaks 46~beta-1
ProcVersionSignature: Ubuntu 6.8.0-11.11-generic 6.8.0-rc4
Uname: Linux 6.8.0-11-generic x86_64
ApportVersion: 2.28.0-0ubuntu1
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Sun Mar 10 02:48:50 2024
ExecutablePath: /usr/bin/gnome-tweaks
InstallationDate: Installed on 2024-02-14 (25 days ago)
InstallationMedia: Ubuntu 24.04 LTS "Noble Numbat" - Daily amd64 (20240212)
InterpreterPath: /usr/bin/python3.12
PackageArchitecture: all
ProcCmdline: /usr/bin/python3 /usr/bin/gnome-tweaks
ProcEnviron:
 LANG=en_US.UTF-8
 PATH=(custom, no user)
 SHELL=/bin/bash
 XDG_RUNTIME_DIR=<set>
Python3Details: /usr/bin/python3.12, Python 3.12.2, python3-minimal, 3.12.1-0ubuntu2
PythonArgs: ['/usr/bin/gnome-tweaks']
PythonDetails: N/A
SourcePackage: gnome-tweaks
Title: gnome-tweaks crashed with TypeError in __init__(): Gtk.Image.new_from_icon_name() takes exactly 1 argument (2 given)
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip docker lpadmin plugdev sudo users

Revision history for this message
Roman (vient1) wrote :
information type: Private → Public
Roman (vient1)
description: updated
description: updated
tags: removed: need-duplicate-check
Changed in gnome-tweaks (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Jeremy Bícha (jbicha) wrote :

It sounds like you have a .desktop file in your ~/.config/autostart/ that does not have an icon associated. (That is a hidden folder). Are you willing to post that file?

A copy might also be in ~/.local/share/applications/

Revision history for this message
Roman (vient1) wrote :

In autostart, I have exactly one file - Telegram, installed from https://flathub.org/apps/org.telegram.desktop:

$ cat ~/.config/autostart/org.telegram.desktop.desktop
[Desktop Entry]
Type=Application
Name=org.telegram.desktop
Exec=flatpak run --command=telegram-desktop org.telegram.desktop -autostart
X-Flatpak=org.telegram.desktop

~/.local/share/applications has one .desktop file without Icon= in it, honestly I am not sure where did it even come from:

$ cat ~/.local/share/applications/userapp-Firefox-YMM3I2.desktop
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
NoDisplay=true
Exec=/usr/lib/firefox/firefox-bin %u
Name=Firefox
Comment=Custom definition for Firefox

Revision history for this message
Jeremy Bícha (jbicha) wrote :

As a workaround to be able to start the Tweaks app, you can edit the telegram autostart desktop file and add an Icon line like this. It doesn't matter that the icon file probably doesn't even exist.

Icon=telegram

The Firefox .desktop file doesn't matter for this issue.

Changed in gnome-tweaks (Ubuntu):
status: New → Triaged
importance: Medium → High
Revision history for this message
Roman (vient1) wrote :

Checked this, adding the line fixes the issue, Tweaks now launches just fine. Thanks!

Revision history for this message
Khairul Aizat Kamarudzzaman (fenris) wrote (last edit ):

> gnome-tweaks

Traceback (most recent call last):
  File "/usr/bin/gnome-tweaks", line 99, in <module>
    from gtweak.app import GnomeTweaks
  File "/usr/lib/python3/dist-packages/gtweak/app.py", line 13, in <module>
    from gtweak.tweakview import Window
  File "/usr/lib/python3/dist-packages/gtweak/tweakview.py", line 20, in <module>
    from gtweak.tweaks.tweak_group_startup import TWEAK_GROUP as StartupApplicationTweaks
  File "/usr/lib/python3/dist-packages/gtweak/tweaks/tweak_group_startup.py", line 347, in <module>
    TWEAK_GROUP = AutostartTweakGroup()
                  ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/gtweak/tweaks/tweak_group_startup.py", line 243, in __init__
    self._setup_startup_app_row()
  File "/usr/lib/python3/dist-packages/gtweak/tweaks/tweak_group_startup.py", line 269, in _setup_startup_app_row
    app_row = _StartupAppRowTweak(dfile)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/gtweak/tweaks/tweak_group_startup.py", line 191, in __init__
    app_icon = Gtk.Image.new_from_icon_name("image-missing", Gtk.IconSize.LARGE)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Gtk.Image.new_from_icon_name() takes exactly 1 argument (2 given)

Changed in gnome-tweaks:
status: Unknown → New
Jeremy Bícha (jbicha)
Changed in gnome-tweaks (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-tweaks - 46~beta-2

---------------
gnome-tweaks (46~beta-2) unstable; urgency=high

  * Cherry-pick proposed patch to fix crash on start with certain autostart
    files (LP: #2056657) (Closes: #1066867)

 -- Jeremy Bícha <email address hidden> Thu, 14 Mar 2024 14:53:00 -0400

Changed in gnome-tweaks (Ubuntu):
status: Fix Committed → Fix Released
Changed in gnome-tweaks:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.