Edgewall Software
Modify

Opened 19 years ago

Closed 18 years ago

#1875 closed defect (fixed)

Ooops in deleting report

Reported by: Emmanuel Blot Owned by: Christopher Lenz
Priority: high Milestone: 0.9
Component: report system Version: 0.9
Severity: major Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

trunk [2048], PySQLite 2

Python traceback

Traceback (most recent call last):
  File "/local/engine/trac/trac/web/modpython_frontend.py", line 207, in handler
    dispatch_request(mpr.path_info, mpr, env)
  File "/local/engine/trac/trac/web/main.py", line 453, in dispatch_request
    dispatcher.dispatch(req)
  File "/local/engine/trac/trac/web/main.py", line 313, in dispatch
    resp = chosen_handler.process_request(req)
  File "/local/engine/trac/trac/ticket/report.py", line 125, in process_request
    self._render_confirm_delete(req, db, id)
  File "/local/engine/trac/trac/ticket/report.py", line 199, in _render_confirm_delete
    req.hdf['title'] = 'Delete Report {%s} %s' % (id, row['title'])
TypeError: tuple indices must be integers

Attachments (0)

Change History (5)

comment:1 by Shun-ichi Goto <gotoh@…>, 19 years ago

I've encounted, too. Here is a patch:

Index: report.py
===================================================================
--- report.py	(revision 2048)
+++ report.py	(working copy)
@@ -196,11 +196,12 @@
         if not row:
             raise util.TracError('Report %s does not exist.' % id,
                                  'Invalid Report Number')
-        req.hdf['title'] = 'Delete Report {%s} %s' % (id, row['title'])
+        idx = [desc[0] for desc in cursor.description].index('title')
+        req.hdf['title'] = 'Delete Report {%s} %s' % (id, row[idx])
         req.hdf['report'] = {
             'id': id,
             'mode': 'delete',
-            'title': util.escape(row['title']),
+            'title': util.escape(row[idx]),
             'href': self.env.href.report(id)
         }
 

comment:2 by Christopher Lenz, 19 years ago

Owner: changed from daniel to Christopher Lenz
Priority: normalhigh
Severity: normalmajor
Status: newassigned

comment:3 by Christopher Lenz, 19 years ago

Resolution: fixed
Status: assignedclosed

Fixed in [2049].

comment:4 by wd40@…, 18 years ago

Milestone: 0.9
Resolution: fixed
Status: closedreopened
Version: devel0.9.3

Getting the same problem in 0.9.3 again (never tried deleting reports before that, so not really sure the problem wasn't there all along).

System: Win2K, Apache 2.0.54, mod_python 3.1.3, ActivePython 2.3.5, PySQLite 1.1.6

Traceback:

Traceback (most recent call last):
  File "C:\Python23\Lib\site-packages\trac\web\modpython_frontend.py", line 206, in handler
    dispatch_request(mpr.path_info, mpr, env)
  File "C:\Python23\Lib\site-packages\trac\web\main.py", line 139, in dispatch_request
    dispatcher.dispatch(req)
  File "C:\Python23\Lib\site-packages\trac\web\main.py", line 107, in dispatch
    resp = chosen_handler.process_request(req)
  File "C:\Python23\Lib\site-packages\trac\ticket\report.py", line 115, in process_request
    self._render_confirm_delete(req, db, id)
  File "C:\Python23\Lib\site-packages\trac\ticket\report.py", line 198, in _render_confirm_delete
    req.hdf['report'] = {
AttributeError: 'module' object has no attribute 'row'

comment:5 by Christian Boos, 18 years ago

Milestone: 0.9
Resolution: fixed
Status: reopenedclosed
Version: 0.9.30.9

The above problem was actually a regression introduced in r2685 and has nothing to do with the problem reported initially in this ticket.

A more specific ticket for the above problem has been created and fixed by now (#2613).

Thanks for the report… and for having checked the ticket DB first!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christopher Lenz.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christopher Lenz 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.