Immediately after enabling the developer plugin in a particular environment I started getting an IndexError with this traceback on every page:
File "/usr/local/lib/python2.5/site-packages/trac/web/main.py", line 438, in _dispatch_request
dispatcher.dispatch(req)
File "/usr/local/lib/python2.5/site-packages/trac/web/main.py", line 230, in dispatch
data, content_type)
File "/usr/local/lib/python2.5/site-packages/trac/web/chrome.py", line 745, in render_template
stream.render(method, doctype=doctype, out=buffer)
File "/usr/local/lib/python2.5/site-packages/genshi/core.py", line 179, in render
return encode(generator, method=method, encoding=encoding, out=out)
File "/usr/local/lib/python2.5/site-packages/genshi/output.py", line 61, in encode
for chunk in iterator:
File "/usr/local/lib/python2.5/site-packages/genshi/output.py", line 311, in __call__
for kind, data, pos in stream:
File "/usr/local/lib/python2.5/site-packages/genshi/output.py", line 753, in __call__
for kind, data, pos in stream:
File "/usr/local/lib/python2.5/site-packages/genshi/output.py", line 592, in __call__
for kind, data, pos in stream:
File "/usr/local/lib/python2.5/site-packages/genshi/output.py", line 698, in __call__
for kind, data, pos in chain(stream, [(None, None, None)]):
File "/usr/local/lib/python2.5/site-packages/genshi/output.py", line 532, in __call__
for ev in stream:
File "/usr/local/lib/python2.5/site-packages/genshi/core.py", line 283, in _ensure
for event in stream:
File "/usr/local/lib/python2.5/site-packages/genshi/core.py", line 283, in _ensure
for event in stream:
File "/usr/local/lib/python2.5/site-packages/trac/web/chrome.py", line 811, in _strip_accesskeys
for kind, data, pos in stream:
File "/usr/local/lib/python2.5/site-packages/genshi/core.py", line 283, in _ensure
for event in stream:
File "/usr/local/lib/python2.5/site-packages/trac/web/chrome.py", line 800, in _generate
for kind, data, pos in stream:
File "/usr/local/lib/python2.5/site-packages/genshi/core.py", line 283, in _ensure
for event in stream:
File "/usr/local/lib/python2.5/site-packages/genshi/core.py", line 283, in _ensure
for event in stream:
File "/mnt/hgfs/home/Source/tracdeveloperplugin/trunk/tracdeveloper/log.py", line 64, in fn
first_time = req._tracdeveloper_hdlr.buf[0].created
Eventually I realized that it was because nothing was coming up in the log during that request (as the log level was set to WARNING). Clearly this feature was meant to be used with the log level set to DEBUG, which would make sense for development purposes. But this bit me by trying to use the plugin in an environment where DEBUG would not be the default.
Perhaps the log module should itself log a warning if the log level is set above DEBUG.