1352: Uncaught TypeError when entering multiple lengthy bug #s for a review request

th***@google.g********* (Google Code) (Is this you? Claim this profile.)
chipx86
chipx86
Oct. 9, 2009
What version are you running?
1.0.4

What's the URL of the page containing the problem?
https://reviewboard.<domain>/api/json/reviewrequests/<#>/publish/

What steps will reproduce the problem?
1. Post a review for a repository that has an issue tracker assigned
2. Enter two lengthy numerical bug IDs, such as 012006153200030304432009,
012006153200030304432010
3. Publish

What is the expected output? What do you see instead?

Sorting the bug #s fails with a TypeError, which is not anticipated by the
code:

Request Method: POST 
Request URL: https://reviewboard.<domain>/api/json/reviewrequests/<#>/publish/
Exception Type: TypeError
Exception Value: comparison function must return int 
Exception Location: [...]\reviewboard\reviews\models.py in get_bug_list,
line 550 

549 : try:
550 :   bugs.sort(cmp=lambda x,y: int(x) - int(y))
551 : except ValueError:
552 :   bugs.sort()
#1 th***@google.g********* (Google Code) (Is this you? Claim this profile.)
I submitted a patch proposal at: http://reviews.review-board.org/r/1168/
chipx86
#2 chipx86
Fixed on master (r10b5857) and release-1.0.x (r62b792c).
  • +Fixed
  • +Milestone-Release1.0.x
    +Component-Reviews
  • +chipx86