Comment 3 for bug 107169

Revision history for this message
GuilhemBichot (guilhem-bichot) wrote :

I'm seeing the same exception when doing "bzr gannotate some_file":
Traceback (most recent call last):
  File "/home/mysql_src/logiciels/bzr_latest_branch2/bzrlib/commands.py", line 846, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/home/mysql_src/logiciels/bzr_latest_branch2/bzrlib/commands.py", line 802, in run_bzr
    ret = run(*run_argv)
  File "/home/mysql_src/logiciels/bzr_latest_branch2/bzrlib/commands.py", line 504, 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 40, in <module>
    bus = dbus.SessionBus()
  File "/usr/lib64/python2.5/site-packages/dbus/_dbus.py", line 671, in __new__
    mainloop=mainloop)
  File "/usr/lib64/python2.5/site-packages/dbus/_dbus.py", line 295, in __new__
    mainloop=mainloop)
DBusException: org.freedesktop.DBus.Error.Spawn.ExecFailed: Failed to execute dbus-launch to autolaunch D-Bus session

As seahorse is not strictly needed, from what I see in revisionview.py:
try:
    from bzrlib.plugins.gtk import seahorse
except ImportError:
    has_seahorse = False
else:
    has_seahorse = True
wouldn't it be simpler and more robust to just let seahorse.py code fail (propagate the exception) and catch all exceptions in the above 'except', saying that any exception in seahorse is not fatal and just means we won't use seahorse?
At least when I do this, gannotate seems to work.