[Web-SIG] Direct use of sys.stdout, sys.stderr and sys.stdin in WSGI application.

Alan Kennedy pywebsig at alan.kennedy.name
Thu Mar 22 17:52:01 CET 2007

[Alan Kennedy]
>>Strictly speaking, WSGI requires python 2.2,
>>because of iterators.

[Phillip J. Eby]
> Actually, it doesn't.  The pre-2.2 iterator protocol is to be used in such
> cases:
> http://www.python.org/dev/peps/pep-0333/#supporting-older-2-2-versions-of-python

Dang! I knew I couldn't say anything on web-sig without being contradicted ;-)

I am familiar with that section. I'm sure you remember writing this in
the credits section: "Alan Kennedy, whose courageous attempts to
implement WSGI-on-Jython (well before the spec was finalized) helped
to shape the "supporting older versions of Python" section".

But if the users want their "modern" python applications to be
portable everywhere on WSGI, e.g. returning (iterable) files as ouput,
or generators, then they should really stick with 2.2+.

But you are, of course, right about the pre-2.2 iterator protocol. I
wrote modjy for jython 2.1 according to the PEP guidelines, and have
had user reports that it works without modification on jython 2.2+.



More information about the Web-SIG mailing list