Modify ↓
Opened 17 years ago
Closed 17 years ago
#5593 closed defect (fixed)
db upgrades broken
Reported by: | Owned by: | Christian Boos | |
---|---|---|---|
Priority: | highest | Milestone: | 0.11 |
Component: | admin/console | Version: | devel |
Severity: | blocker | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
I was upgrading from to r5468 to r5748 and got this:
Command failed: iteration over non-sequence
with no backtrace! Had to somehow divine that trac-admin is run through trac/admin/console.py (the body of trac-admin gives no clue) and comment out the exception handler to debug this. The following patch fixes it:
-
trac/upgrades/db21.py
3 3 """Upgrade the reports to better handle the new workflow capabilities""" 4 4 db = env.get_db_cnx() 5 5 owner = db.concat('owner', "' *'") 6 reports = list(cursor.execute('SELECT id, query, description FROM report')) 6 reports = list(cursor.execute('SELECT id, query, description FROM report') 7 or ()) 7 8 for report, query, description in reports: 8 9 # All states other than 'closed' are "active". 9 10 query = query.replace("IN ('new', 'assigned', 'reopened')",
Attachments (0)
Note:
See TracTickets
for help on using tickets.
#5575 was closed as duplicate. I've closed it in favor of this one, as there was a patch here.
But upon further examination, the patch is not correct, as the return value of
cursor.execute
is not specified (see PEP:0249), and used to beNone
(see PEP:0248).So I'll use
fetchall
instead.