indicator-cpufreq crashes when logging into desktop

Bug #1969850 reported by Dan Bastianello
34
This bug affects 5 people
Affects Status Importance Assigned to Milestone
indicator-cpufreq (Ubuntu)
Confirmed
High
Unassigned

Bug Description

The error when running from terminal is:
~$ indicator-cpufreq
/usr/lib/python3/dist-packages/indicator_cpufreq/indicator.py:22: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '4.0') before import to ensure that the right version gets loaded.
  from gi.repository import Gtk
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gi/importer.py", line 142, in load_module
    introspection_module = get_introspection_module(namespace)
  File "/usr/lib/python3/dist-packages/gi/module.py", line 257, in get_introspection_module
    module = IntrospectionModule(namespace, version)
  File "/usr/lib/python3/dist-packages/gi/module.py", line 109, in __init__
    repository.require(namespace, version)
gi.RepositoryError: Requiring namespace 'Gtk' version '3.0', but '4.0' is already loaded

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/indicator-cpufreq", line 77, in <module>
    from indicator_cpufreq.indicator import MyIndicator
  File "/usr/lib/python3/dist-packages/indicator_cpufreq/indicator.py", line 23, in <module>
    from gi.repository import AppIndicator3 as appindicator
  File "/usr/lib/python3/dist-packages/gi/importer.py", line 144, in load_module
    raise ImportError(e)
ImportError: Requiring namespace 'Gtk' version '3.0', but '4.0' is already loaded

I do have a solution though, which is by adding to the imports in '/usr/lib/python3/dist-packages/indicator_cpufreq/indicator.py' the following:

import gi <<< this line
gi.require_version("Gtk", "3.0") <<< and this line
from gi.repository import GLib
from gi.repository import Gtk
from gi.repository import AppIndicator3 as appindicator
<snip>

The indicator-cpufreq app will launch successfully.

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: indicator-cpufreq 0.2.2-0ubuntu3 [modified: usr/lib/python3/dist-packages/indicator_cpufreq/indicator.py]
ProcVersionSignature: Ubuntu 5.15.0-25.25-generic 5.15.30
Uname: Linux 5.15.0-25-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu82
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Thu Apr 21 16:38:54 2022
InstallationDate: Installed on 2021-10-11 (191 days ago)
InstallationMedia: Ubuntu 21.04 "Hirsute Hippo" - Release amd64 (20210420)
PackageArchitecture: all
SourcePackage: indicator-cpufreq
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Dan Bastianello (dbastianello1337) wrote :
Changed in indicator-cpufreq (Ubuntu):
importance: Undecided → High
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in indicator-cpufreq (Ubuntu):
status: New → Confirmed
Revision history for this message
MilkBoy (michael-wikberg) wrote :

Confirmed that previously mentioned patch works

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "indicator.py.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Pavel Plesov (frewq28) wrote :

The indicator.py.patch provided here does its job. indicator-cpufreq seem to work correctly and does not fail.

Ubuntu 22.04

Revision history for this message
Mmortal03 (mmortal03) wrote :
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.