Edgewall Software
Modify

Ticket #2830 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

sort by component oopses

Reported by: Andres Salomon <dilinger@…> Owned by: jonas
Priority: normal Milestone: 0.10
Component: general Version: devel
Severity: normal Keywords:
Cc:
Release Notes:
API 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

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

Download all attachments as: .zip

Change History

Changed 6 years ago by Andres Salomon <dilinger@…>

Fix column sort oops, against r2946.

comment:1 Changed 6 years ago by mgood

  • Resolution set to fixed
  • Status changed from new to closed

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 Changed 6 years ago by anonymous

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:3 Changed 6 years ago by cmlenz

  • Resolution set to fixed
  • Status changed from reopened to closed

Please don't reopen without a comment.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from jonas. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.