gcommit crashes with 'ImportError: could not import gobject' on clean Ubuntu 12

Bug #1159840 reported by GuilhemBichot on 2013-03-25
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar GTK+ Frontends

Bug Description

This has been reproduced on two machines of two different developers, both are Ubuntu 12.04 32 bits English, with bzr and bzr-gtk both installed from the Ubuntu software Center.

0.047 bazaar version: 2.5.1
0.047 bzr arguments: [u'gcommit']
0.049 looking for plugins in /home/fsilva/.bazaar/plugins
0.250 looking for plugins in /usr/lib/python2.7/dist-packages/bzrlib/plugins
0.250 Plugin name bzrtools already loaded
0.256 encoding stdout as sys.stdout encoding 'UTF-8'
0.257 Transferred: 0kB (0.0kB/s r:0kB w:0kB)
0.258 Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 920, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 1131, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 673, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 695, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 136, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/gtk/commands.py", line 295, in run
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/gtk/commands.py", line 49, in open_display
    from gi.repository import Gtk
  File "/usr/lib/python2.7/dist-packages/gi/__init__.py", line 23, in <module>
    from ._gi import _API, Repository
ImportError: could not import gobject (error was: ImportError('When using gi.repository you must not import static modules like "gobject". Please change all occurrences of "import gobject" to "from gi.repository import GObject".',))

Note that bzr-gtk from the Ubuntu software Center is bzr-gtk3.
if I manually install bzr-gtk2 from:
into my ~/.bazaar/plugins (thus hiding the bzr-gtk from the Ubuntu software Center), everything works fine.
Because of this problem occurs on "vanilla", "not hacked" Ubuntu 12 installations, using standard packages, we fear that this is going to be widespread.

GuilhemBichot (guilhem-bichot) wrote :

Both crashing machines are ubuntu 12 32-bit. Some colleagues on Ubuntu 12 64-bit don't have the problem.

GuilhemBichot (guilhem-bichot) wrote :

Another colleague hit this. Please do something.

GuilhemBichot (guilhem-bichot) wrote :

Bug can be closed!
After debugging, the issue is not rooted in bzr-gtk3. We have, on top of bzr-gtk3, another plugin which uses gtk2; that plugin does "import gtk". bzr-gtk3 loads gtk3 with "import gi.repository". Both ways to import are incompatible: "import gi.repository" refuses to work because of "import gtk".
Conclusion: it's not possible to have plugins which use different versions of gtk.

GuilhemBichot (guilhem-bichot) wrote :

clarifying "We have, on top of bzr-gtk3, another plugin which uses gtk2": by "on top" I don't mean any relation between the two plugins; "in addition to" would be a better word.

Vincent Ladeuil (vila) wrote :

Thanks for the feedback, marking the bug as wontfix in case other people encounter similar issues.

Changed in bzr-gtk:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers