[Web-SIG] Another WSGI gotcha to be aware of
Phillip J. Eby
pje at telecommunity.com
Sat Aug 25 18:34:25 CEST 2007
At 11:45 PM 8/24/2007 -0700, Robert Brewer wrote:
>However, and here's the rub, if nextapp() raises an
>exception, **self.response is never bound**, and
>therefore we have no handle to the object we need
>to close. Note that this is not a middleware-only
>problem; servers can run into this too.
>The spec says, "In general, applications *should* try to
>trap their own, internal errors"; we might want to make
>that a MUST in future versions. Alternately, we could
>require that every application provide its resource-
>releasing endpoint via some means other than a successful
>response. I'm sure you all can come up with other solutions.
I don't see a problem here to solve. If the application didn't
return a response, the middleware naturally isn't obligated to call
close() on it.
More information about the Web-SIG