#6336 closed defect (fixed)
AttributeError: 'list' object has no attribute 'items'
Reported by: | C. M. | Owned by: | John Hampton |
---|---|---|---|
Priority: | high | Component: | TaskListPlugin |
Severity: | major | Keywords: | |
Cc: | Trac Release: | 0.12 |
Description (last modified by )
This could very well be of my own fault - but I may need a little help figuring it out.
Since upgrading Trac to 0.12, I haven't been able to use TaskList and I miss it. This error is displayed when trying to access /tasklist
File "/usr/local/lib/python2.5/site-packages/Trac-0.12dev_r8641-py2.5.egg/trac/web/main.py", line 467, in _dispatch_request dispatcher.dispatch(req) File "/usr/local/lib/python2.5/site-packages/Trac-0.12dev_r8641-py2.5.egg/trac/web/main.py", line 212, in dispatch resp = chosen_handler.process_request(req) File "build/bdist.linux-i686/egg/tasklist/main.py", line 99, in process_request
User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729) Trac: 0.12dev-r8641 Python: 2.5.1 (r251:54863, Jan 11 2008, 10:58:38) [GCC 3.4.3 20041212 (Red Hat 3.4.3-10)] setuptools: 0.6c7 MySQL: server: "5.0.45-community", client: "5.0.45", thread-safe: 0 MySQLdb: 1.2.2 Genshi: 0.6dev-r1052 Babel: - mod_python: 3.3.1 Pygments: 0.9 Subversion: 1.4.6 (r28521) jQuery: 1.3.2
Attachments (0)
Change History (10)
comment:1 Changed 15 years ago by
comment:2 Changed 14 years ago by
In main.py change lines 99-102 from
for field, vals in constraints.items(): for val in vals: if val.endswith('$USER'): del constraints[field]
to
for field, vals in constraints[0].items(): for val in vals: if val.endswith('$USER'): del constraints[0][field]
comment:3 Changed 14 years ago by
Description: | modified (diff) |
---|
comment:4 Changed 14 years ago by
I'm dealing with what looks like the same issue for the TracHoursPlugin in #7996. I have a fix just like that shown in comment:2, however I wonder if we should also be iterating over constraints, since it can be a list.
comment:5 Changed 14 years ago by
It looks like we might be able to get away with replacing constraints
with constraints[0]
as long as there are no OR clauses in the query. Can anyone confirm that this is a safe assumption?
comment:6 Changed 14 years ago by
I also wonder why the change to the Query class is not discussed in t:TracDev/ApiChanges/0.12.
comment:9 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:10 Changed 14 years ago by
I put in place what I think is a safe fix, by iterating over constraints
. This may not be necessary, and I made a note about this in the source code.
There is now a branch for 0.11 and the trunk is compatible with 0.12.
See also googlegroups:trac-users:7488291261db4071 for some explanations about the error.