Skip to content

Commit

Permalink
- Address heisenbug reported where performance panel template variabl…
Browse files Browse the repository at this point in the history
…es cause

  unexpected results.  Can't repeat, but reporter indicates the fix works for
  him, so hail marying.
  • Loading branch information
mcdonc committed Nov 17, 2011
1 parent 4132323 commit 5719c97
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Next release
------------

- Address heisenbug reported where performance panel template variables cause
unexpected results. Can't repeat, but reporter indicates the fix works for
him, so hail marying.

0.9.5 (2011-11-12)
------------------

Expand Down
2 changes: 2 additions & 0 deletions pyramid_debugtoolbar/panels/performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ def content(self):
if self.is_active:
vars['stats'] = self.stats
vars['function_calls'] = self.function_calls
else:
vars['stats'] = None
return self.render(
'pyramid_debugtoolbar.panels:templates/performance.mako',
vars, request=self.request)
Expand Down

1 comment on commit 5719c97

@mcdonc
Copy link
Member Author

@mcdonc mcdonc commented on 5719c97 Nov 17, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original traceback:

URL: http://127.0.0.1:5000/?flash=1
File '/home/marcink/.virtualenvs/monitoring-dashboard/lib/python2.6/site-packages/WebError-0.10.3-py2.6.egg/weberror/evalexception.py', line 431 in respond
app_iter = self.application(environ, detect_start_response)
File '/home/marcink/.virtualenvs/monitoring-dashboard/lib/python2.6/site-packages/pyramid-1.2.1-py2.6.egg/pyramid/router.py', line 176 in call
response = self.handle_request(request)
File '/home/marcink/.virtualenvs/monitoring-dashboard/lib/python2.6/site-packages/pyramid_debugtoolbar-0.9.5-py2.6.egg/pyramid_debugtoolbar/toolbar.py', line 157 in toolbar_tween
toolbar.process_response(response)
File '/home/marcink/.virtualenvs/monitoring-dashboard/lib/python2.6/site-packages/pyramid_debugtoolbar-0.9.5-py2.6.egg/pyramid_debugtoolbar/toolbar.py', line 55 in process_response
vars, request=request)
File '/home/marcink/.virtualenvs/monitoring-dashboard/lib/python2.6/site-packages/pyramid-1.2.1-py2.6.egg/pyramid/renderers.py', line 69 in render
return helper.render(value, None, request=request)
File '/home/marcink/.virtualenvs/monitoring-dashboard/lib/python2.6/site-packages/pyramid-1.2.1-py2.6.egg/pyramid/renderers.py', line 418 in render
result = renderer(value, system_values)
File '/home/marcink/.virtualenvs/monitoring-dashboard/lib/python2.6/site-packages/pyramid-1.2.1-py2.6.egg/pyramid/mako_templating.py', line 155 in call
raise MakoRenderingException(errtext)
MakoRenderingException:

Traceback (most recent call last):
File "/home/marcink/.virtualenvs/monitoring-dashboard/lib/python2.6/site-packages/pyramid-1.2.1-py2.6.egg/pyramid/mako_templating.py", line 147, in call
result = template.render_unicode(*_system)
File "/home/marcink/.virtualenvs/monitoring-dashboard/lib/python2.6/site-packages/Mako-0.5.0-py2.6.egg/mako/template.py", line 311, in render_unicode
as_unicode=True)
File "/home/marcink/.virtualenvs/monitoring-dashboard/lib/python2.6/site-packages/Mako-0.5.0-py2.6.egg/mako/runtime.py", line 660, in _render
*_kwargs_for_callable(callable, data))
File "/home/marcink/.virtualenvs/monitoring-dashboard/lib/python2.6/site-packages/Mako-0.5.0-py2.6.egg/mako/runtime.py", line 692, in _render_context
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/home/marcink/.virtualenvs/monitoring-dashboard/lib/python2.6/site-packages/Mako-0.5.0-py2.6.egg/mako/runtime.py", line 718, in exec_template
callable
(context, _args, *_kwargs)
File "/home/marcink/.virtualenvs/monitoring-dashboard/lib/python2.6/site-packages/pyramid_debugtoolbar-0.9.5-py2.6.egg/pyramid_debugtoolbar/templates/toolbar.mako", line 61, in render_body
${panel.content()|n}
File "/home/marcink/.virtualenvs/monitoring-dashboard/lib/python2.6/site-packages/pyramid_debugtoolbar-0.9.5-py2.6.egg/pyramid_debugtoolbar/panels/performance.py", line 204, in content
vars, request=self.request)
File "/home/marcink/.virtualenvs/monitoring-dashboard/lib/python2.6/site-packages/pyramid_debugtoolbar-0.9.5-py2.6.egg/pyramid_debugtoolbar/panels/init.py", line 24, in render
return render(template_name, vars, request=request)
File "/home/marcink/.virtualenvs/monitoring-dashboard/lib/python2.6/site-packages/pyramid-1.2.1-py2.6.egg/pyramid/renderers.py", line 69, in render
return helper.render(value, None, request=request)
File "/home/marcink/.virtualenvs/monitoring-dashboard/lib/python2.6/site-packages/pyramid-1.2.1-py2.6.egg/pyramid/renderers.py", line 418, in render
result = renderer(value, system_values)
File "/home/marcink/.virtualenvs/monitoring-dashboard/lib/python2.6/site-packages/pyramid-1.2.1-py2.6.egg/pyramid/mako_templating.py", line 155, in call
raise MakoRenderingException(errtext)
MakoRenderingException:

Traceback (most recent call last):
File "/home/marcink/.virtualenvs/monitoring-dashboard/lib/python2.6/site-packages/pyramid-1.2.1-py2.6.egg/pyramid/mako_templating.py", line 147, in call
result = template.render_unicode(*_system)
File "/home/marcink/.virtualenvs/monitoring-dashboard/lib/python2.6/site-packages/Mako-0.5.0-py2.6.egg/mako/template.py", line 311, in render_unicode
as_unicode=True)
File "/home/marcink/.virtualenvs/monitoring-dashboard/lib/python2.6/site-packages/Mako-0.5.0-py2.6.egg/mako/runtime.py", line 660, in _render
*_kwargs_for_callable(callable, data))
File "/home/marcink/.virtualenvs/monitoring-dashboard/lib/python2.6/site-packages/Mako-0.5.0-py2.6.egg/mako/runtime.py", line 692, in _render_context
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/home/marcink/.virtualenvs/monitoring-dashboard/lib/python2.6/site-packages/Mako-0.5.0-py2.6.egg/mako/runtime.py", line 718, in exec_template
callable
(context, _args, *_kwargs)
File "/home/marcink/.virtualenvs/monitoring-dashboard/lib/python2.6/site-packages/pyramid_debugtoolbar-0.9.5-py2.6.egg/pyramid_debugtoolbar/panels/templates/performance.mako", line 1, in render_body
% if timing_rows:
NameError: 'function_calls' is not defined

Please sign in to comment.