[Web-SIG] app iterable containing non-strings

Adam Atlas adam at atlas.st
Sun Dec 16 07:22:03 CET 2007

The spec says "Regardless of how it is accomplished, the application  
object must always return an iterable yielding zero or more strings."  
The "must" means that anything else should be considered an error (I  
think). If your middleware does anything to the iterated strings, then  
you'll have to catch non-strings and raise the error yourself, but  
otherwise, it's not your middleware's business, and I'd say it should  
be left to the gateway (or any other lower point in the WSGI stack  
that happens to notice it).

On 16 Dec 2007, at 01:10, Ionel Maries Cristian wrote:

> I was reading the wsgi spec and i was wondering how should
> middleware treat the iterable that happens to contain values
> that aren't strings (and I'm not talking about unicodes)  - the spec  
> isn't explicit on this.
> If middleware would just pass on values that aren't string
> instances - this could be a mechanism for server extensions.
> (besides the environ)
> -- 
> http://code.google.com/p/cogen/
> ionel.
> _______________________________________________
> Web-SIG mailing list
> Web-SIG at python.org
> Web SIG: http://www.python.org/sigs/web-sig
> Unsubscribe: http://mail.python.org/mailman/options/web-sig/adam%40atlas.st

More information about the Web-SIG mailing list