django-debug-toolbar/django-debug-toolbar — Issue #247: inspect.traceback generates error
Author: matthewleon
Created: 2012-01-11 00:25:28+00:00
State: open

My site is running on Python 2.5. Attempting to load any page with once django-debug-toolbar is installed results in the following error. Given that I find no mention of inspect.Traceback in Python's docs, it makes sense to me:

```
mod_wsgi (pid=7529): Exception occurred processing WSGI script '/home2/kfi/webapps/kfitest/kfi/kfi.wsgi'.
Traceback (most recent call last):
File "/home2/kfi/.virtualenvs/kfitest/lib/python2.5/site-packages/django/core/handlers/wsgi.py", line 245, in __call__
response = middleware_method(request, response)
File "/home2/kfi/.virtualenvs/kfitest/lib/python2.5/site-packages/debug_toolbar/middleware.py", line 128, in process_response
panel.process_response(request, response)
File "/home2/kfi/.virtualenvs/kfitest/lib/python2.5/site-packages/debug_toolbar/panels/request_vars.py", line 58, in process_response
'session': [(k, self.request.session.get(k)) for k in self.request.session.iterkeys()]
File "/home2/kfi/.virtualenvs/kfitest/lib/python2.5/site-packages/django/contrib/sessions/backends/base.py", line 115, in iterkeys
return self._session.iterkeys()
File "/home2/kfi/.virtualenvs/kfitest/lib/python2.5/site-packages/django/contrib/sessions/backends/base.py", line 172, in _get_session
self._session_cache = self.load()
File "/home2/kfi/.virtualenvs/kfitest/lib/python2.5/site-packages/django/contrib/sessions/backends/db.py", line 16, in load
expire_date__gt=datetime.datetime.now()
File "/home2/kfi/.virtualenvs/kfitest/lib/python2.5/site-packages/django/db/models/manager.py", line 120, in get
return self.get_query_set().get(*args, **kwargs)
File "/home2/kfi/.virtualenvs/kfitest/lib/python2.5/site-packages/django/db/models/query.py", line 300, in get
num = len(clone)
File "/home2/kfi/.virtualenvs/kfitest/lib/python2.5/site-packages/django/db/models/query.py", line 81, in __len__
self._result_cache = list(self.iterator())
File "/home2/kfi/.virtualenvs/kfitest/lib/python2.5/site-packages/django/db/models/query.py", line 238, in iterator
for row in self.query.results_iter():
File "/home2/kfi/.virtualenvs/kfitest/lib/python2.5/site-packages/django/db/models/sql/query.py", line 287, in results_iter
for rows in self.execute_sql(MULTI):
File "/home2/kfi/.virtualenvs/kfitest/lib/python2.5/site-packages/django/db/models/sql/query.py", line 2369, in execute_sql
cursor.execute(sql, params)
File "/home2/kfi/.virtualenvs/kfitest/lib/python2.5/site-packages/debug_toolbar/utils/tracking/db.py", line 77, in execute
stacktrace = tidy_stacktrace(reversed(get_stack()))
File "/home2/kfi/.virtualenvs/kfitest/lib/python2.5/site-packages/debug_toolbar/utils/__init__.py", line 146, in get_stack
framelist.append((frame,) + getframeinfo(frame, context))
File "/home2/kfi/.virtualenvs/kfitest/lib/python2.5/site-packages/debug_toolbar/utils/__init__.py", line 132, in getframeinfo
return inspect.Traceback(filename, lineno, frame.f_code.co_name, lines, index)
AttributeError: 'module' object has no attribute 'Traceback'
```