hugday crashes if the bug is listed more than once on the wiki page
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
hugday tools |
New
|
Undecided
|
Unassigned |
Bug Description
If a bug appears more than once on the BugDay wiki page ie: in as a New bug and also as a Bug to be forwarded upstream. For example bug 370837 on https:/
Traceback (most recent call last):
File "/usr/bin/hugday", line 411, in <module>
sys.
File "/usr/bin/hugday", line 404, in main
close_
File "/usr/bin/hugday", line 339, in close_bugs
bugs.remove(nr)
ValueError: list.remove(x): x not in list
A workaround is to list the bug number on the command line as many times as it appears on the wiki, so for the above bug "hugday close 370837 370837" works.
I've attached a quick patch that fixes this bug. The bug occurs because the close_bugs function removes the bug number from the bugs list after finding the first matching line on the wiki page. Subsequent wiki lines that match LINE_RE with the same bug number, cannot remove the bug number from bugs as it has already been removed, and the script crashes. A quick check that the bugs list contains the bug nr before removing nr seems the easiest solution to this.
Feel free to ignore this if you have a more elegant solution :)