Permalink
Browse files

- Address heisenbug reported where performance panel template variabl…

…es cause

  unexpected results.  Can't repeat, but reporter indicates the fix works for
  him, so hail marying.
1 parent 4132323 commit 5719c97ea2a3a41fc01e261403d0167cc38f3b49 @mcdonc mcdonc committed Nov 17, 2011
Showing with 9 additions and 0 deletions.
  1. +7 −0 CHANGES.txt
  2. +2 −0 pyramid_debugtoolbar/panels/performance.py
View
@@ -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)
------------------
@@ -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)

1 comment on commit 5719c97

Owner

mcdonc commented on 5719c97 Nov 17, 2011

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.