Phillip J. Eby wrote: > So here are my recommendations so far for the addendum to WSGI *1.0* for > Python 3.0 (I expect we can be more strict for WSGI 2.0): > > * When running under Python 3, applications SHOULD produce bytes output > and headers > > * When running under Python 3, servers and gateways MUST accept strings > as application output or headers, under the existing rules (i.e., > s.encode('latin-1') must convert the string to bytes without an exception) > > * 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?)
I believe that SCRIPT_NAME/PATH_INFO would be UTF8 encoded, not latin1. That is, after you urldecode the values (as WSGI asks you to do) proper conversion to text is to decode it as UTF8. I'm a bit confused on how HTTP_COOKIE gets encoded. And QUERY_STRING also confuses me. Is this all compatible with os.environ in py3k? I don't care that much if it does, but as the starting point for CGI it would be interesting if it stays in sync. -- Ian Bicking : [EMAIL PROTECTED] : http://blog.ianbicking.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