Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

#2830 closed defect (fixed)

sort by component oopses

Reported by: Andres Salomon <dilinger@…> Owned by: Jonas Borgström
Priority: normal Milestone: 0.10
Component: general Version: devel
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Hi,

When sorting by component, I managed to trigger the following traceback:

Python traceback

Traceback (most recent call last):
  File "/usr/local/lib/python2.3/site-packages/trac/web/modpython_frontend.py", line 206, in handler
    dispatch_request(mpr.path_info, mpr, env)
  File "/usr/local/lib/python2.3/site-packages/trac/web/main.py", line 142, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/local/lib/python2.3/site-packages/trac/web/main.py", line 110, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/local/lib/python2.3/site-packages/trac/ticket/report.py", line 116, in process_request
    resp = self._render_view(req, db, id)
  File "/usr/local/lib/python2.3/site-packages/trac/ticket/report.py", line 317, in _render_view
    rows.sort(sorter.sort)
AttributeError: 'tuple' object has no attribute 'sort'

The fix is pretty trivial; it is expected that execute_report() is returning lists, not tuples.

Attachments (1)

trac-sortfix-r2946.patch (703 bytes ) - added by Andres Salomon <dilinger@…> 19 years ago.
Fix column sort oops, against r2946.

Download all attachments as: .zip

Change History (4)

by Andres Salomon <dilinger@…>, 19 years ago

Attachment: trac-sortfix-r2946.patch added

Fix column sort oops, against r2946.

comment:1 by Matthew Good, 19 years ago

Resolution: fixed
Status: newclosed

The problem was apparently due to MySQLdb returning tuples from cursor.fetchall() instead of lists. I cleaned up the code a bit in [2947] to use sorted() instead of the comparator which fixes this as well.

comment:2 by anonymous, 19 years ago

Resolution: fixed
Status: closedreopened

comment:3 by Christopher Lenz, 19 years ago

Resolution: fixed
Status: reopenedclosed

Please don't reopen without a comment.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.