alacarte crashed with ImportError in /usr/share/alacarte/Alacarte/util.py : cannot import name GError

Bug #1086369 reported by dino99 on 2012-12-04
84
This bug affects 20 people
Affects Status Importance Assigned to Milestone
Alacarte Menu Editor
Fix Released
Critical
alacarte (Ubuntu)
Medium
Unassigned

Bug Description

Get that crash after right clicking on Applications menu on RR i386 logged as gnome-classic.
As apport also fail to report and apport-cli is also broken, i send the crash file below.

Related branches

dino99 (9d9) wrote :
dino99 (9d9) wrote :

oem@oem-desktop:~$ apt-cache policy alacarte
alacarte:
  Installé : 3.6.1-0ubuntu2
  Candidat : 3.6.1-0ubuntu2
  Table de version :
 *** 3.6.1-0ubuntu2 0
        500 http://archive.ubuntu.com/ubuntu/ raring/universe i386 Packages
        100 /var/lib/dpkg/status

Traceback (most recent call last):
   File "/usr/bin/alacarte", line 23, in <module>
     from Alacarte.MainWindow import MainWindow
   File "/usr/share/alacarte/Alacarte/MainWindow.py", line 32, in <module>
     from Alacarte.MenuEditor import MenuEditor
   File "/usr/share/alacarte/Alacarte/MenuEditor.py", line 23, in <module>
     from Alacarte import util
   File "/usr/share/alacarte/Alacarte/util.py", line 25, in <module>
     from gi._glib import GError
 ImportError: cannot import name GError

Launchpad Janitor (janitor) wrote :

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

Changed in alacarte (Ubuntu):
status: New → Confirmed

Same problem.

root@Dungeon-of-Data:~# apt-cache policy alacarte
alacarte:
  Installed: 3.6.1-0ubuntu2
  Candidate: 3.6.1-0ubuntu2
  Version table:
 *** 3.6.1-0ubuntu2 0
        500 http://us.archive.ubuntu.com/ubuntu/ raring/universe i386 Packages
        100 /var/lib/dpkg/status

root@Dungeon-of-Data:~# apt-cache policy alacarte
alacarte:
  Installed: 3.6.1-0ubuntu2
  Candidate: 3.6.1-0ubuntu2
  Version table:
 *** 3.6.1-0ubuntu2 0
        500 http://us.archive.ubuntu.com/ubuntu/ raring/universe i386 Packages
        100 /var/lib/dpkg/status

root@Dungeon-of-Data:~# alacarte
Traceback (most recent call last):
  File "/usr/bin/alacarte", line 23, in <module>
    from Alacarte.MainWindow import MainWindow
  File "/usr/share/alacarte/Alacarte/MainWindow.py", line 32, in <module>
    from Alacarte.MenuEditor import MenuEditor
  File "/usr/share/alacarte/Alacarte/MenuEditor.py", line 23, in <module>
    from Alacarte import util
  File "/usr/share/alacarte/Alacarte/util.py", line 25, in <module>
    from gi._glib import GError
ImportError: cannot import name GError

Francois Thirioux (fthx) wrote :

I simply removed the line with

from gi._glib import GError

in the file :

/usr/share/alacarte/Alacarte/util.py

I do not know if it is a dirty workaround, but it does succeed to start alacarte...

Francois Thirioux (fthx) wrote :

I meant :
removed with inserting a # before the bad line...

Jeremy Bicha (jbicha) on 2013-01-16
Changed in alacarte (Ubuntu):
importance: Undecided → Medium
Martin Pitt (pitti) wrote :

Indeed, accessing PyGObject internals through gi._glib is wrong, and does not work any more with pygobject 3.7. Instead, please use the official API:

  from gi.repository.GLib import GError

or drop the line completely if it isn't being used anywhere.

Changed in alacarte (Ubuntu):
status: Confirmed → Triaged
Changed in alacarte:
importance: Unknown → Critical
status: Unknown → New
Changed in alacarte:
status: New → Fix Released
Burak Göksoy (rbgoksoy) wrote :

6. method; to remove failure lines is worked.

ek0892 (kranich) wrote :

me too :

 File "/usr/bin/alacarte", line 23, in <module>
    from Alacarte.MainWindow import MainWindow
  File "/usr/share/alacarte/Alacarte/MainWindow.py", line 32, in <module>
    from Alacarte.MenuEditor import MenuEditor
  File "/usr/share/alacarte/Alacarte/MenuEditor.py", line 23, in <module>
    from Alacarte import util
  File "/usr/share/alacarte/Alacarte/util.py", line 25, in <module>
    from gi._glib import GError
ImportError: cannot import name GError

ek0892 (kranich) wrote :

for fix / resolv , this is my solution :

in the terminal :

sudo sed -i -e '/from gi._glib/ s/^from */### from/' /usr/share/alacarte/Alacarte/util.py

dino99 (9d9) wrote :

Thanks kranich,

after having executed to #11 command, alacarte stop crashing and can be used normally.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package alacarte - 3.6.1-0ubuntu3

---------------
alacarte (3.6.1-0ubuntu3) raring; urgency=low

  * debian/patches/git_use_glib-gerror.patch:
    - Use GLib.GError for catching errors (LP: #1086369)
 -- Matthieu Baerts (matttbe) <email address hidden> Thu, 31 Jan 2013 02:38:20 +0100

Changed in alacarte (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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