Querying available plugin options crashes with KeyError: 'dry-run'

Bug #954663 reported by Florian Rathgeber
32
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Bazaar Externals plugin
Fix Committed
Undecided
Unassigned

Bug Description

As of bzr 2.5 'dry-run' is not an automatically registered global option anymore. Hence querying valid options for the plugin in bzrlib.commands.options fails with KeyError: 'dry-run'. This is particularly annoying since this query is used to determine possible bash completions i.e. bzr crashes each time you hit Tab in a bzr command line.

The backtrace is as follows (Ubuntu 11.10, bzr 2.5.0-2~bazaar1~oneiric2, python-bzrlib 2.5.0-2~bazaar1~oneiric2):

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/bash_completion/bashcomp.py", line 441, in run
    bash_completion_function(sys.stdout, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/bash_completion/bashcomp.py", line 402, in bash_completion_function
    data = dc.collect()
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/bash_completion/bashcomp.py", line 305, in collect
    self.commands()
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/bash_completion/bashcomp.py", line 325, in commands
    self.command(name)
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/bash_completion/bashcomp.py", line 354, in command
    opts = cmd.options()
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 631, in options
    o = option.Option.OPTIONS[o]
KeyError: 'dry-run'

Related branches

Changed in bzr-externals:
status: New → Confirmed
Changed in bzr-externals:
status: Confirmed → Fix Committed
Revision history for this message
Christian Reis (kiko) wrote :

I don't think this is only a problem in bzr-externals, unfortunately, because on a Precise installation containing

 ii bzr 2.5.0-2ubuntu2 easy to use distributed version control system
ii bzr-fastimport 0.13.0-1 Fast-import/fast-export plugin for Bazaar
ii bzrtools 2.5-1 Collection of tools for bzr
ii python-bzrlib 2.5.0-2ubuntu2 distributed version control system - python library

I am still seeing this issue (and I don't seem to even have an externals.py file on my filesystem).

Revision history for this message
Christian Reis (kiko) wrote :

bzr 2.5.0 on python 2.7.3 (Linux-3.2.0-25-generic-x86_64-with-
    Ubuntu-12.04-precise)
arguments: ['/usr/bin/bzr', 'bash-completion']
plugins: bash_completion[2.5.0], bzrtools[2.5.0], changelog_merge[2.5.0],
    cia[1.0.0dev], fastimport[0.13.0], launchpad[2.5.0], lpreview[unknown],
    netrc_credential_store[2.5.0], news_merge[2.5.0], po_merge[2.5.0],
    weave_fmt[2.5.0]
encoding: 'utf-8', fsenc: 'UTF-8', lang: 'en_US.UTF8'

Revision history for this message
Christian Reis (kiko) wrote :

Sorry for adding to the confusion here. I have a different problem with the same symptom, apparently caused by the "review-submit" command which I have installed in this server. Still researching..

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 954663] Re: Querying available plugin options crashes with KeyError: 'dry-run'

Christian Reis пишет:
> I don't think this is only a problem in bzr-externals, unfortunately,
> because on a Precise installation containing
>
> ii bzr 2.5.0-2ubuntu2 easy to use distributed version control system
> ii bzr-fastimport 0.13.0-1 Fast-import/fast-export plugin for Bazaar
> ii bzrtools 2.5-1 Collection of tools for bzr
> ii python-bzrlib 2.5.0-2ubuntu2 distributed version control system - python library
>
> I am still seeing this issue (and I don't seem to even have an
> externals.py file on my filesystem).

If you want to raise this issue against bzr core or bzrtools or
bzr-fastimport you'd better file a bug against bzr itself and let
developers to find out the cause.

--
All the dude wanted was his rug back

Revision history for this message
Christian Reis (kiko) wrote :

Okay, I now understand the whole shebang. The ancient version of the lpreview plugin I have installed had the same issue, and a very similar fix could be applied to it. Sorry for the noise!

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.