gnome-sudoku ERROR:root:Could not find any typelib for LaunchpadIntegration

Bug #1050063 reported by Anthony Harrington
32
This bug affects 6 people
Affects Status Importance Assigned to Milestone
gnome-games (Ubuntu)
Fix Released
Medium
Unassigned
Precise
Won't Fix
Low
Unassigned

Bug Description

ant@laptoppy:~$ gnome-sudoku
ERROR:root:Could not find any typelib for LaunchpadIntegration
Traceback (most recent call last):
  File "/usr/games/gnome-sudoku", line 23, in <module>
    start_game()
  File "/usr/lib/python2.7/dist-packages/gnome_sudoku/gnome_sudoku.py", line 21, in start_game
    import main
  File "/usr/lib/python2.7/dist-packages/gnome_sudoku/main.py", line 9, in <module>
    from gi.repository import LaunchpadIntegration
ImportError: cannot import name LaunchpadIntegration

This is a minimalistic system and as such a lot of packages have been taken out.
Any attempt to start the program is met with no visible activity.

Commenting out lines 9, 182 and 183 from /usr/lib/python2.7/dist-packages/gnome_sudoku/main.py disables launchpad integration but the program then runs perfectly again.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: gnome-sudoku 1:3.4.1-0ubuntu2.1
ProcVersionSignature: Ubuntu 3.2.0-31.50-generic-pae 3.2.28
Uname: Linux 3.2.0-31-generic-pae i686
ApportVersion: 2.0.1-0ubuntu13
Architecture: i386
Date: Wed Sep 12 22:03:58 2012
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Alpha i386 (20120322)
PackageArchitecture: all
SourcePackage: gnome-games
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Anthony Harrington (linuxchemist) wrote :
Revision history for this message
Robert Roth (evfool) wrote :

Not having launchpad-integration is not really a good reason to crash, so maybe the ubuntu patch should be updated to try... except on the ImportError and simply don't use launchpadlib integration in case it can not be imported.

Changed in gnome-games (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Anthony Harrington (linuxchemist) wrote :

Bug also occurs on the default version of gnome-sudoku in precise (3.4.1-0ubuntu1) as well as precise-updates version (3.4.1-0ubuntu2.1).
Bug occurs if you remove packages "gir1.2-launchpadintegration-3.0" and "launchpad-integration" and try to open gnome-sudoku - since these packages are installed by default, users who haven't removed them will not come across this problem but those that do will be unable to open gnome-sudoku.

I have a patch suggestion but i'd appreciate it if someone could give it a look over.

1) Edit main.py which resides in /usr/lib/python2.7/dist-packages/gnome_sudoku/main.py when installed.

2) Delete line 9 containing "from gi.repository import LaunchpadIntegration" - it only seems to be used by the setup_gui() function on line 171 and there doesn't appear to be any harm in doing so.

3) Change the setup_gui() function on line 171 to the following (or similar): http://pastie.org/4720780
(I've left some comments - for example, does gnome-sudoku actually have an error log to write to? Printing 'launchpad integration error' or similar to the terminal would suffice i think. At the very least, at least the program will actually run now!)

Program then runs happily. :)

Revision history for this message
Anthony Harrington (linuxchemist) wrote :

Oh, i see now!
Launchpad integration is added via a patch called 01_lpi.patch in (for example) gnome-games_3.4.1-0ubuntu2.1.debian.tar.gz in folder "/debian/patches" from lines 132-159.

and that's where the true bug lies because the code that it adds to gnome-sudoku should be more like what i've suggested above in comment 3. This situation will repeat itself with further versions of gnome-sudoku while that patch is added as it is.

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

This is fixed in Ubuntu 12.10 Beta "Quantal Quetzal" as launchpad-integration has been dropped.

Changed in gnome-games (Ubuntu):
status: New → Fix Released
Revision history for this message
Anthony Harrington (linuxchemist) wrote :

Yes, but what about users on 12.04.1 LTS - a long term support STABLE release - unable to open the program to play sudoku?

If this is the case, I really think an update should be pushed that removes the launchpad integration patch from the version in precise, or at the very least writes in a conditional workaround like i suggested. It's a simple update, really.

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

Well, to be fair, it's not typical for someone to have Ubuntu 12.04 LTS installed but not have launchpad-integration installed.

I'll take a patch to either have gnome-sudoku depend on gir1.2-launchpadintegration-3.0 or to fix the patch to check if LPI is installed. You ought to check all the games in gnome-games to see if they are affected.

Changed in gnome-games (Ubuntu Precise):
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Anthony Harrington (linuxchemist) wrote :

Roger that, i'll have a look through the list in gnome-games and see what needs to be changed in the patch.
Making gnome-sudoku dependent on gir1.2-launchpadintegration-3.0 is a bad move (just ends up pulling in not likely needed fluff), so i'll get to it and report back when i have news :)

Revision history for this message
Anthony Harrington (linuxchemist) wrote :

Right then, let's see now.
Had a look at all the games listed under the patch:
glchess
gnect
gnibbles
gnobots2
gnome-sudoku
gnotski
gtali
glines
gnomine
iagno
lightsoff
mahjonng
quadrapassel

and this whole 'launchpad integration' bug seems to only be affecting gnome-sudoku because all the others run fine even without the 2 affecting packages ('launchpad-integration' and 'gir1.2-launchpad-integration-3.0')

I've therefore used Meld to output the difference between an unpatched main.py (before any LPI patch hits it) and the changes i posted above in comment 3 which check for launchpad-integration, output an error if it can't find anything, but run the program nonetheless. At least now it's not show stopping.

Regarding this new 01_LPI.patch - only the contents between lines 132 and 157 need to be changed but i'm not 100% sure i've done it right, so i'd appreciate it if you could give it a once over lol.
The python indentation of my revised main.py runs smoothly without indentation errors but the way it looks on the patch looks a bit sketchy: Is it OK?
I'm also a bit confused why gnome-games 3.4.1 has 'gnome-games-3.3.91' in the 01_LPI.patch used, but i'm new to .diff and .patch files (still learning lol). I checked and the patch in question has not changed between gnome-games 3.4.1-0ubuntu1 (Precise) and 3.4.1-0ubuntu2.1 (Precise updates).

If this new patch is used instead when building, gnome-sudoku should check for launchpad integration and run :D

Revision history for this message
Anthony Harrington (linuxchemist) wrote :

Oh damn, i see why the indentation looks wrong - I think i mixed some tabs and spaces. Rookie mistake XD Corrected. Made sure they were spaced properly.

Looks better now, i think :)

Revision history for this message
Anthony Harrington (linuxchemist) wrote :

bumping

I was going to make a proper merge request out of my patch above but i had some trouble compiling gnome-games properly even without any launchpad-integration stuff.
I think my patch looks alright though - i know the code i'm suggesting to add to gnome-sudoku solves the problem and the change to the LPI patch which precise uses adds my changed code in place of what was causing the crashing. In theory, it should solve the problem nicely.

Revision history for this message
Steve Langasek (vorlon) wrote :

The Precise Pangolin has reached end of life, so this bug will not be fixed for that release

Changed in gnome-games (Ubuntu Precise):
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
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.