[Reportbug-maint] Bug#794590: breaks debian-bug command in Emacs

Sven Joachim svenjoac at gmx.de
Thu Aug 6 15:49:00 UTC 2015


Control: tags -1 +patch

On 2015-08-04 19:56 +0200, Sven Joachim wrote:

> Package: reportbug
> Version: 6.6.4
> Severity: important
>
> With this version of reportbug, the "debian-bug" command in Emacs
> (from the debian-el package) is broken.  Regardless of the package to
> report a bug for, reportbug prints a backtrace instead of the package
> info:
>
> ,----
> |   File "/usr/bin/reportbug", line 2235, in <module>
> |     main()
> |   File "/usr/bin/reportbug", line 1002, in main
> |     (options, args) = parser.parse_args()
> |   File "/usr/lib/python2.7/optparse.py", line 1400, in parse_args
> |     stop = self._process_args(largs, rargs, values)
> |   File "/usr/lib/python2.7/optparse.py", line 1444, in _process_args
> |     self._process_short_opts(rargs, values)
> |   File "/usr/lib/python2.7/optparse.py", line 1551, in _process_short_opts
> |     option.process(opt, value, values, self)
> |   File "/usr/lib/python2.7/optparse.py", line 789, in process
> |     self.action, self.dest, opt, value, values, parser)
> |   File "/usr/lib/python2.7/optparse.py", line 809, in take_action
> |     self.callback(self, opt, value, parser, *args, **kwargs)
> |   File "/usr/bin/reportbug", line 760, in verify_append_option
> |     elif value in valid:
> | TypeError: argument of type 'function' is not iterable
> `----

An easy way to reproduce this is to "reportbug -T none" without any
further arguments.  The culprit is commit 60389048cfe85e9856c6543fb57
("--tag cli option now correctly generates the list of available tags
based on the selected mode, which includes 'security'; Closes: #685826).
This commit only special-cases the --tag option, but not the short -T
alias.  The following fix works for me:

--8<---------------cut here---------------start------------->8---
diff --git a/bin/reportbug b/bin/reportbug
index c5b5345..c47a7e9 100755
--- a/bin/reportbug
+++ b/bin/reportbug
@@ -752,7 +752,7 @@ def verify_append_option(option, opt, value, parser, *args):
     # special case --tag: in valid we pass a function reference
     # as get_tags is dependant on the user mode, so we also have to convert
     # the mode to the integer value expected... FIXME
-    if opt == '--tag':
+    if opt == '--tag' or opt == '-T':
         valid = sorted(valid(mode=utils.MODELIST.index(parser.values.mode)).keys())+['none']
     if value == 'help':
         ewrite('%s:\n %s\n' % (heading, '\n '.join(valid)))
--8<---------------cut here---------------end--------------->8---

Cheers,
       Sven



More information about the Reportbug-maint mailing list