[Web-SIG] some questions about start_response implementation
Manlio Perillo
manlio_perillo at libero.it
Mon Oct 15 19:04:09 CEST 2007
Phillip J. Eby ha scritto:
> At 06:21 PM 10/15/2007 +0200, Manlio Perillo wrote:
>> Phillip J. Eby ha scritto:
>> > At 05:52 PM 10/15/2007 +0200, Manlio Perillo wrote:
>> >> Hi.
>> >>
>> >> I'm implementing the start_response callable for Nginx mod_wsgi and I
>> >> have a few questions.
>> >>
>> >> 1) From the WSGI PEP it seems that an implementation is allowed to
>> >> *always* raise an exception when start_response is called with
>> a not
>> >> null exc_info.
>> >>
>> >> Is this true?
>> >
>> > Yes - as long as it's the exc_info passed in, i.e.:
>>
>> It seems that WSGI *does not* requires the application to raise the
>> exc_info passed.
>
> We're talking about the *server*, not the application:
>
Sorry, I have written application, but I meant server :-).
> "if exc_info is provided, and the HTTP headers have already been sent,
> start_response MUST raise an error, and SHOULD raise the exc_info tuple."
>
> So, it's a "should" for the server, with the intent being that you
> should have some special reason for not doing so. This is later
> clarified in the PEP as meaning that exception-handling middleware may
> have reasons to raise an alternative error or not raise an error.
> However, there aren't any anticipated use cases for server gateways to
> do anything but raise the passed-in errors.
>
Ok, thanks for the clarification.
> [...]
Regards Manlio Perillo
More information about the Web-SIG
mailing list