I just returned from PyCon in Chicago. During the conference open spaces there was an open space discussing potential changes for WSGI. The three basic ideas were:
- Return a tuple with the status, headers, and response instead using the start response function.
- Use unicode (utf-8) by default. This mainly effects the encoding of headers and values in the environ dict.
- Make the WSGI input an interable instead of a file like object.
The unicode issue seemed to eventually be loosely agreed upon in that the server would say what encoding it uses and the application can then override that if necessary.
The change of WSGI input was a little more complicated. To those that don't know, the WSGI input is effectively like the request body. In the world of RESTful services there is the chance this could be a very large file, so it is common for middleware to stream the content. The issue with it being a file is that middleware can effectively destroy it by simply using it. This is why there was an idea to change it to an iterator of some sort in order to allow middleware to safely use the value in the environ dict without effecting other aspects of the application.
If you are interested in following along with the conversation, check out the Python Web SIG mailing list.