gannotate: dies with AttributeError: 'module' object has no attribute 'validate_bus_name'

Bug #224632 reported by GuilhemBichot on 2008-04-30
2
Affects Status Importance Assigned to Milestone
Bazaar GTK+ Frontends
Undecided
Unassigned

Bug Description

gannotate from 0.93.0 worked but after upgrading bzr-gtk to the latest branch it fails with:

Traceback (most recent call last):
  File "/usr/local/lib/python2.5/site-packages/bzrlib/commands.py", line 834, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/local/lib/python2.5/site-packages/bzrlib/commands.py", line 790, in run_bzr
    ret = run(*run_argv)
  File "/usr/local/lib/python2.5/site-packages/bzrlib/commands.py", line 492, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/guilhem/.bazaar/plugins/gtk/__init__.py", line 298, in run
    from annotate.gannotate import GAnnotateWindow
  File "/home/guilhem/.bazaar/plugins/gtk/annotate/gannotate.py", line 31, in <module>
    from bzrlib.plugins.gtk.revisionview import RevisionView
  File "/home/guilhem/.bazaar/plugins/gtk/revisionview.py", line 30, in <module>
    from bzrlib.plugins.gtk import seahorse
  File "/home/guilhem/.bazaar/plugins/gtk/seahorse.py", line 32, in <module>
    dbus.validate_bus_name(BUS_NAME)
AttributeError: 'module' object has no attribute 'validate_bus_name'

bzr 1.3 on python 2.5.0.final.0 (linux2)

The reason is that validate_bus_name requires dbus 0.80 and my dbus is 0.71 (default of opensuse 10.2). Upgrading is not trivial on this machine.
The code does try to survive errors: seahorse.py has:
try:
    dbus.validate_bus_name(BUS_NAME)
except ValueError:
    raise ImportError
and then revisionview.py:
try:
    from bzrlib.plugins.gtk import seahorse
except ImportError:
    has_seahorse = False
else:
    has_seahorse = True
But what I get is not ValueError but AttributeError, so it's not caught... If I change seahorse.py to catch any exception and not just ValueError, gannotate seems to work fine again.

GuilhemBichot (guilhem-bichot) wrote :

Latest bzr-gtk has the fix (line 37 rev 480 May 1st). You can close the bug. Thanks!

Jelmer Vernooij (jelmer) on 2008-05-04
Changed in bzr-gtk:
milestone: none → 0.94.0
status: New → Fix Committed
Jelmer Vernooij (jelmer) on 2008-08-04
Changed in bzr-gtk:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers