[Web-SIG] Sketching a WSGI 2-to-1 adapter with greenlets

P.J. Eby pje at telecommunity.com
Sat Sep 19 07:03:16 CEST 2009


At 06:58 PM 9/18/2009 -0500, Ian Bicking wrote:
>What's wrong with this simpler approach to the conversion?

It's not compliant with the WSGI 1 spec, which calls for write() to 
be unbuffered.

On the one hand, you could say that anybody who gives a crap about 
the spec wouldn't use write() to begin with.  But then, on the other, 
if we ignore the spec ourselves, we're hardly in a position to 
complain about their behavior.  ;-)

Anyway, Graham raised the difficulty of making a compliant adapter as 
an argument for having a WSGI 1.1 rather than jumping straight to 
2.0, and I just wanted to show that it's not that difficult in 
principle to make a fully WSGI 1.0-compliant 2-to-1 adapter, at least 
if you cheat and use greenlets to handle the less well-behaved WSGI 1 apps.

The hairiest bits of defining 2.0 have more to do with nailing down 
the whole bytes/unicode/native circus, the input stream API, 
etc...  most of which I hope we can do in the errata for 1.0.



More information about the Web-SIG mailing list