internal errors not handled properly for chunked encoding pages #166

scyclops opened this Issue Jul 8, 2012 · 0 comments


None yet

1 participant


In, the wsgi function on line 269 does special handling when handle_with_processors() returns a generator (for pages using chunked encoding). The peep'ing on the results of these generators may raise exceptions due to bugs in user code to generate responses. When there are exceptions raised here, they aren't handled by internalerror which causes end users to see plain text Python stack traces in their browser.

The below class is a simple test case that should trigger this problem:

class Test(object):
  def GET(self):
    a = 1/0
    yield ''

To fix this problem, I moved the peep'ing on the generator into the process function within the handle_with_processors method (line 232) so that any exceptions are properly caught and handled by the call to internalerror there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment