Since upgrading to Trac 12, TaskList is no longer working. It maybe
something I've caused but I'm at a loss where to look.
AttributeError: 'list' object has no attribute 'items'
Python Traceback
Most recent call last:
* File "build/bdist.linux-i686/egg/trac/web/main.py", line 495, in
_dispatch_request
Local variables:
Name Value
dispatcher <trac.web.main.RequestDispatcher object at
0xb71d658c>
e AttributeError("'list' object has no attribute 'items'",)
env <trac.env.Environment object at 0xb777562c>
env_error None
exc_info (<type 'exceptions.AttributeError'>, AttributeError
("'list' object has no ...
faulty_plugins []
frames []
has_admin True
message u"AttributeError: 'list' object has no attribute
'items'"
plugins []
req <Request "GET u'/tasklist'">
resp []
th 'http://trac-hacks.org'
traceback u'Traceback (most recent call last):\n File ...
tracker 'http://trac.edgewall.org'
* File "build/bdist.linux-i686/egg/trac/web/main.py", line 227, in
dispatch
Local variables:
Name Value
chosen_handler <tasklist.main.TasklistPlugin object at
0xb719e3ec>
chrome <trac.web.chrome.Chrome object at 0xb719986c>
err (<type 'exceptions.AttributeError'>, AttributeError("'list'
object has no ...
handler <tasklist.main.TasklistPlugin object at 0xb719e3ec>
req <Request "GET u'/tasklist'">
self <trac.web.main.RequestDispatcher object at 0xb71d658c>
* File "build/bdist.linux-i686/egg/tasklist/main.py", line 99, in
process_request
Local variables:
Name Value
constraints [{u'status': [u'!closed'], u'owner':
[u'ctmurphy']}]
qstring u'status!=closed&owner=ctmurphy'
req <Request "GET u'/tasklist'">
self <tasklist.main.TasklistPlugin object at 0xb719e3ec>
user u'ctmurphy'
File "build/bdist.linux-i686/egg/trac/web/main.py", line 495, in
_dispatch_requestFile "build/bdist.linux-i686/egg/trac/web/main.py",
line 227, in dispatchFile "build/bdist.linux-i686/egg/tasklist/
main.py", line 99, in process_request
System Information:
User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2)
Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)
Trac 0.12dev-r9050
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
pytz 2007k
MySQL server: "5.0.45-community", client: "5.0.45", thread-safe: 0
MySQLdb 1.2.2
Genshi 0.6dev-r1092
Babel -
mod_python 3.3.1
Pygments 0.9
Subversion 1.4.6 (r28521)
jQuery 1.3.2
Thank you for your assistance.
Cathy
It looks like the plugin is using the Query class, which has changed in
0.12 for OR clauses. Before the change, constraints was a dict, and now
it's a list of dicts. The plugin will have to be adapted for that.
See here for the full story:
http://trac.edgewall.org/ticket/2647
I haven't looked at the plugin, but you might get away with replacing
"constraints" with "constraints[0]" at every location where the error
pops up, depending on how the query is constructed.
-- Remy