[Web-SIG] Future of WSGI
Tres Seaver
tseaver at palladion.com
Wed Nov 25 21:03:26 CET 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Aaron Watters wrote:
>
> --- On Wed, 11/25/09, Chris Dent <chris.dent at gmail.com> wrote:
>
>> From: Chris Dent <chris.dent at gmail.com>
>> I can (barely) relate to some of the complaints that
>> start_response is a pain in the ass, but environ, to me, is
>> not broken.
>
> I agree. It maps nicely onto the underlying protocol
> and WSGI is supposed to be low level right?
>
> The biggest problem with start_response is that after
> you evaluate
>
> iterable = application(env, start_response)
>
> Sometimes the start_response has been called and sometimes
> it hasn't, and this can break middlewares when they haven't
> been tested both ways (repose.who for example seems to
> assume it has been called).
Since version 1.0.13 (2009-04-24), repoze.who's middleware is very
careful to dance around the fact that an application is not required to
have called 'start_response' on return, but *must* call it before
returning the first chunk from its iterator. That bit of flexibility in
PEP 333 is likely there to support *some* use case, but it makes
'start_response' a *big* pain to work with in middleware which needs to
to "egress" processing of headers.
Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 tseaver at palladion.com
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAksNjYkACgkQ+gerLs4ltQ6M4ACgj8Ist6sCLUgJ/BrAlXP0QlN4
OEMAnjuWY0NEK+3IKc8igdaJx0wrlNqy
=ncqc
-----END PGP SIGNATURE-----
More information about the Web-SIG
mailing list