WSGI spec clarification regarding exceptions

Adam Atlas adam at atlas.st
Wed May 9 18:26:16 EDT 2007


I'm trying to figure out if there's any defined behaviour in PEP 333
for instances where an application returns an iterable as usual
without error, but that iterable's next() method eventually raises an
exception. Since any data theretofore returned by the iterable must be
assumed to have already been written to the client, thus making it
impossible to replace the response with a 500 error or somesuch, does
the gateway just absorb the exception and cut off the response there?
It seems like that's pretty much all it could do, but I'm wondering if
that's explicitly specified anywhere (I couldn't find anything about
that in the PEP).




More information about the Python-list mailing list