Edgewall Software

Ticket #1875 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Ooops in deleting report

Reported by: eblot Owned by: cmlenz
Priority: high Milestone: 0.9
Component: report system Version: 0.9
Severity: major Keywords:
Cc:

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

Change History

Changed 3 years ago by Shun-ichi Goto <gotoh@…>

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)
         }
 

Changed 3 years ago by cmlenz

  • owner changed from daniel to cmlenz
  • priority changed from normal to high
  • status changed from new to assigned
  • severity changed from normal to major

Changed 3 years ago by cmlenz

  • status changed from assigned to closed
  • resolution set to fixed

Fixed in [2049].

Changed 3 years ago by wd40@…

  • status changed from closed to reopened
  • version changed from devel to 0.9.3
  • resolution fixed deleted
  • milestone 0.9 deleted

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'

Changed 3 years ago by cboos

  • status changed from reopened to closed
  • version changed from 0.9.3 to 0.9
  • resolution set to fixed
  • milestone set to 0.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!

Add/Change #1875 (Ooops in deleting report)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.