Graham Dumpleton wrote: > Based on any discussions at PyCon, can someone give a summary of any > conclusions drawn about how WSGI 1.0 should be implemented in Python > 3.0. > > The previous analysis of this is at: > > http://www.wsgi.org/wsgi/Amendments_1.0 > > I realise it may be work in progress, but I note that work being done > on WSGI server associated with CherryPy for Python 3.0 by Robert isn't > necessarily following that and is perhaps starting to do things in a > way that I understood were only being speculated upon for WSGI 2.0, > not for WSGI 1.0. For example: > > http://www.cherrypy.org/changeset/2199 > > In particular, it has: > > environ["SCRIPT_NAME"] = b"" > > The bit from prior analysis which is relevant is: > > """When running under Python 3, servers MUST provide CGI HTTP > variables as strings, decoded from the headers using HTTP standard > encodings (i.e. latin-1 + RFC 2047) (Open question: are there any CGI > or WSGI variables that should NOT be strings?)""" > > Since mod_wsgi has used the prior analysis as basis of Python 3.0 > support, would want to know pretty soon what direction WSGI 1.0 under > Python 3.0 is going to take, else I am going to have to delay > releasing mod_wsgi 3.0 or simply yank the support for Python 3.0. > > Robert, yes I know I could have asked you direct, but want a consensus > from all who were present at PyCon and discussed these things.
Good timing. We had been thinking to make everything strings except for SCRIPT_NAME, PATH_INFO, and QUERY_STRING, since these few are pulled from the Request-URI, which may be in any encoding. It was thought that the app would be best-qualified to decode those three. I hope to discuss that further this morning at the sprints. Turns out the cgi module in Python 3 only does text, not bytes. I considered submitting a patch to make it handle bytes for fp/environ but that became difficult quickly and may complicate the cgi module needlessly if we can instead use unicode for those 3 environ entries. I'll report back here. Robert Brewer fuman...@aminus.org _______________________________________________ Web-SIG mailing list Web-SIG@python.org Web SIG: http://www.python.org/sigs/web-sig Unsubscribe: http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com