You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue appears to happen when I raise a pyramid.httpexceptions redirect early during a class-based view handler. (in __init__, not call() ). I haven't been able to pinpoint exactly why this happens (version 4.5). The stacktrace below.
I tweaked the debugtoolbar class to handle not having a response and can easily submit a PR for it - but this doesn't make much sense to me and I wonder if this is an issue with Pyramid's handling.
2018-12-04 14:01:30,295 ERROR [waitress][waitress] Exception when serving /
Traceback (most recent call last):
File "/Users/jvanasco/webserver/environments/legacy-2.7.13/lib/python2.7/site-packages/waitress/channel.py", line 338, in service
task.service()
File "/Users/jvanasco/webserver/environments/legacy-2.7.13/lib/python2.7/site-packages/waitress/task.py", line 169, in service
self.execute()
File "/Users/jvanasco/webserver/environments/legacy-2.7.13/lib/python2.7/site-packages/waitress/task.py", line 399, in execute
app_iter = self.channel.server.application(env, start_response)
File "/Users/jvanasco/webserver/sites/MyApp/trunk/python-packages/myapp/myapp/pyramid_utils/request.py", line 32, in __call__
return self.application(environ, start_response)
File "/Users/jvanasco/webserver/environments/legacy-2.7.13/lib/python2.7/site-packages/pyramid/router.py", line 270, in __call__
response = self.execution_policy(environ, self)
File "/Users/jvanasco/webserver/environments/legacy-2.7.13/lib/python2.7/site-packages/pyramid/router.py", line 279, in default_execution_policy
return request.invoke_exception_view(reraise=True)
File "/Users/jvanasco/webserver/environments/legacy-2.7.13/lib/python2.7/site-packages/pyramid/view.py", line 768, in invoke_exception_view
reraise_(*exc_info)
File "/Users/jvanasco/webserver/environments/legacy-2.7.13/lib/python2.7/site-packages/pyramid/router.py", line 277, in default_execution_policy
return router.invoke_request(request)
File "/Users/jvanasco/webserver/environments/legacy-2.7.13/lib/python2.7/site-packages/pyramid/router.py", line 260, in invoke_request
request._process_finished_callbacks()
File "/Users/jvanasco/webserver/environments/legacy-2.7.13/lib/python2.7/site-packages/pyramid/request.py", line 138, in _process_finished_callbacks
callback(self)
File "/Users/jvanasco/webserver/environments/legacy-2.7.13/lib/python2.7/site-packages/pyramid_debugtoolbar/panels/headers.py", line 19, in finished_callback
self.process_response_deferred()
File "/Users/jvanasco/webserver/environments/legacy-2.7.13/lib/python2.7/site-packages/pyramid_debugtoolbar/panels/headers.py", line 31, in process_response_deferred
response = self.response
AttributeError: 'HeaderDebugPanel' object has no attribute 'response'
The text was updated successfully, but these errors were encountered:
if you can reproduce this issue then the question is which codepath the request went through the tween in which self.process_response was not invoked. I'd put a breakpoint around [1] and step through until the response goes out.
In my case it turned out to be a UnicodeDecodeError exception in a custom panel's __init__(). Fixing this exception also fixed the issue with HeaderDebugPanel.
Note: the faulty custom panel's class was (way) after the HeaderDebugPanel class in the panel_classes list, so this part of the code should've already ran for HeaderDebugPanel, making me guess it's to do with some later code that doesn't run due to the raised exception. I didn't investigate any further.
The issue appears to happen when I raise a
pyramid.httpexceptions
redirect early during a class-based view handler. (in__init__
, notcall()
). I haven't been able to pinpoint exactly why this happens (version 4.5). The stacktrace below.I tweaked the debugtoolbar class to handle not having a response and can easily submit a PR for it - but this doesn't make much sense to me and I wonder if this is an issue with Pyramid's handling.
The text was updated successfully, but these errors were encountered: