In application.py, 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:
a = 1/0
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.