qbzr crashes pydoc -k

Bug #1044859 reported by Samuel Bronson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QBzr
New
Undecided
Unassigned

Bug Description

When I try to run "pydoc -k foo" on my Mac OS X 10.5 system with bzr, qbzr, pyqt, and colo all installed in PYTHONPATH, pydoc crashes.

It's possible that this issue only occurs with old versions bzr, but it occurs out of the box with the latest bzr installer available for OS X on PowerPC *and* with lp:qbzr and lp:bzr/2.3 (the latest that works with Python 2.5, which is what OS X 10.5 comes with).

Here's a quicker way to get such a crash, that only needs a checkout of lp:bzr/2.3 with a checkout of lp:qbzr placed/linked in the plugin directory (and qt and pyqt):

iMac:bzr user$ python -c 'import bzrlib.plugins.qbzr.lib.commands'Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "./bzrlib/plugins/qbzr/lib/commands.py", line 315, in <module>
    class cmd_qrevert(QBzrCommand):
  File "./bzrlib/plugins/qbzr/lib/commands.py", line 318, in cmd_qrevert
    takes_options = [ui_mode_option, bzr_option('revert', 'no-backup')]
  File "./bzrlib/plugins/qbzr/lib/commands.py", line 225, in bzr_option
    cmd=get_cmd_object(cmd_name, False)
  File "./bzrlib/commands.py", line 243, in get_cmd_object
    raise errors.BzrCommandError('unknown command "%s"' % cmd_name)
bzrlib.errors.BzrCommandError: unknown command "revert"
iMac:bzr user$ ./bzr assert-fail
bzr: ERROR: exceptions.AssertionError: always fails

Traceback (most recent call last):
  File "./bzrlib/commands.py", line 927, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "./bzrlib/commands.py", line 1127, in run_bzr
    ret = run(*run_argv)
  File "./bzrlib/commands.py", line 692, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "./bzrlib/commands.py", line 714, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/Users/user/hacking/bazaar/bzr/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/Users/user/hacking/bazaar/bzr/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "./bzrlib/builtins.py", line 4317, in run
    raise AssertionError("always fails")
AssertionError: always fails

bzr 2.3.5dev on python 2.5.1 (Darwin-9.8.0-Power_Macintosh-powerpc-32bit)
arguments: ['./bzr', 'assert-fail']
plugins: bash_completion[2.3.5dev], bzrtools[2.3.1], colo[0.4.0],
    email[unknown], explorer[1.1.3], extmerge[unknown], fastimport[0.10.0],
    interactive[1.2.0], keychain[0.1.0], launchpad[2.3.5dev], loom[2.2.1dev],
    netrc_credential_store[2.3.5dev], news_merge[2.3.5dev], pipeline[1.1.0],
    qbzr[0.23.1dev], rewrite[0.6.2], svn[1.0.5dev], upload[1.0.1dev],
    xmloutput[0.8.7.dev]
encoding: 'UTF-8', fsenc: 'utf-8', lang: 'en_US.UTF-8'

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/bzr/+filebug
    including this traceback and a description of the problem.

Samuel Bronson (naesten)
affects: bzr → qbzr
Revision history for this message
Alexander Belchenko (bialix) wrote :

You have: bzr 2.3.5dev and qbzr[0.23.1dev]

From README: http://bazaar.launchpad.net/~qbzr-dev/qbzr/trunk2a/view/head:/README.txt#L31
QBzr 0.23 is targeted to bzr 2.6 and compatible with bzr 2.5
It may not work with older versions of bzr.

For bzr 2.3.x you need qbzr 0.21.x.

Changed in qbzr:
status: New → Invalid
Revision history for this message
Samuel Bronson (naesten) wrote :

Well, qbzr 0.20.1 has the exact same issue...

Changed in qbzr:
status: Invalid → New
Revision history for this message
Alexander Belchenko (bialix) wrote :

1) Have you tried qbzr 0.21?
2) As I can see from traceback the actual error comes from bzrlib side, not from qbzr.

affects: qbzr → bzr
Revision history for this message
Alexander Belchenko (bialix) wrote :

Some thoughts.
QBzr is a plugin for bzr, this is not standalone library. It's not intended to be used without bzr as command-line application.
The usual practice to put plugins into bzrlib/plugins/ is the easiest way to get plugin found by bzr, but it's not strictly required. You can put qbzr in any directory of your choice and then specify path to that directory in BZR_PLUGIN_PATH environment variable. So the easiest workaround for you is to move qbzr outside of bzrlib/plugins.

I vaguely remember that bzrlib requires call to special method to initialize built-in commands. Your error said that bzrlib couldn't find built-in command "revert". Possible because of that. Again: if calling qbzr commands from command-line as bzr subcommand you never get this kind of error, because this magic is already done inside bzr. I can imagine the reasons for such behavior (using bzrlib as library for cases when you don't need access to built-in commands), but I'm not quite agree that it's a qbzr's fault that pydoc now crashes because of this implicit black magic.

If the latest assumption is true then one should be able to provide an easy fix for this problem with pydoc. Patches are welcome!

Jelmer Vernooij (jelmer)
affects: bzr → qbzr
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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