[interpid] [bitesize] bugnumbers crashed with ValueError in main()

Bug #271155 reported by Dereck Wonnacott
6
Affects Status Importance Assigned to Milestone
Bug Helper
Fix Released
Medium
Brian Murray
bughelper (Ubuntu)
Fix Released
Undecided
Markus Korn

Bug Description

Binary package hint: bughelper

I simply typed new rather than 'New' and it exploded, but in hardy, bugnumbers died gracefully.

ProblemType: Crash
Architecture: amd64
DistroRelease: Ubuntu 8.10
ExecutablePath: /usr/bin/bugnumbers
InterpreterPath: /usr/bin/python2.5
Package: bughelper 0.2.15
PackageArchitecture: all
ProcAttrCurrent: unconfined
ProcCmdline: /usr/bin/python /usr/bin/bugnumbers --status=new -p --format=bugday --sort=-nr --file=AFile.txt
ProcEnviron:
 SHELL=/bin/bash
 PATH=/home/username/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
 LANG=en_US.UTF-8
PythonArgs: ['/usr/bin/bugnumbers', '--status=new', '-p', '--format=bugday', '--sort=-nr', '--file=AFile.txt']
SourcePackage: bughelper
Title: bugnumbers crashed with ValueError in main()
Uname: Linux 2.6.27-3-generic x86_64
UserGroups: adm admin audio cdrom dialout dip floppy leachers lpadmin netdev plugdev powerdev sambashare scanner video

Tags: apport-crash
Revision history for this message
Dereck Wonnacott (dereck) wrote :
Revision history for this message
Brian Murray (brian-murray) wrote :

Do you know which specific version on Hardy failed more gracefully? I saw the following:

Setting up bughelper (0.2.14) ...
bdmurray@superman:~$ bugnumbers -p bughelper --status new
Traceback (most recent call last):
  File "/usr/bin/bugnumbers", line 324, in <module>
    main()
  File "/usr/bin/bugnumbers", line 210, in main
    raise ValueError, "unknown status: %s" %x
ValueError: unknown status: set(['new'])

Changed in bughelper:
status: New → Incomplete
Revision history for this message
Markus Korn (thekorn) wrote :

This is also kind of addressed in bug 197037

Some time ago bughelper/numbers etc. did not have any validation of the value given as status and importance option, so no error was raised if there was an unknown value.

But making this option case-insensitive should not be that hard, working on it

Markus

Changed in bughelper:
assignee: nobody → thekorn
status: Incomplete → In Progress
Revision history for this message
Markus Korn (thekorn) wrote :

I think I fixed it with the attached patch (against revno 220 of the main branch),

$ ./bugnumbers -p bughelper --status "new, incOMplete,wOn'T fIx, confirmed" --importance "unDecided, WISHLIST"
226483 (New, Undecided) - bughelper crashed with NotBranchError in find_format()
129341 (New, Wishlist) - bughelper would benefit from the ability to inherit clues from a clue file not named after a package
88102 (Confirmed, Undecided) - sort report by issue type rather than bug number
239007
(Confirmed, Undecided) - clue file for bugs without a package

But for unknown status there is still a ValueError raised:
$ ./bugnumbers -p bughelper --status "booo"
Traceback (most recent call last):
  File "./bugnumbers", line 383, in <module>
    main()
  File "./bugnumbers", line 259, in main
    raise ValueError, "unknown status: %s" %x
ValueError: unknown status: set(['Booo'])

Please test and review the attached patch,
Markus

Revision history for this message
Brian Murray (brian-murray) wrote :

The patch ends up modifying searches for "Incomplete w/" and "Incomplete w/o" to "Incomplete W/" and "Incomplete W/o" which then fails. I've attached a patch that deals with those particular statuses, or we could modify python-launchpad-bugs itself to include an alias for these statuses.

Revision history for this message
Markus Korn (thekorn) wrote :

Brian, your last patch is looking good to me.

Revision history for this message
Brian Murray (brian-murray) wrote :

Resolved in revision 223 of the bzr branch of bughelper.

Changed in bughelper:
assignee: nobody → brian-murray
importance: Undecided → Medium
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bughelper - 0.2.16

---------------
bughelper (0.2.16) intrepid; urgency=low

  * resolved bughelper issue were it would not write results to a file anymore
    (LP: #272655)
  * resolved issues where bugnumbers / bughelper crashes when unknown statuses
    are used - thanks Markus Korn (LP: #271155)

 -- Brian Murray <email address hidden> Wed, 24 Sep 2008 13:30:51 -0700

Changed in bughelper:
status: In Progress → Fix Released
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.