[Web-SIG] Request for Comments on upcoming WSGI Changes

P.J. Eby pje at telecommunity.com
Tue Sep 22 03:01:07 CEST 2009


At 09:16 AM 9/22/2009 +1000, Graham Dumpleton wrote:
>For one, we aren't talking about arbitrary keys needing this treatment.
>
>We are only talking about SCRIPT_NAME and PATH_INFO.
>
>Everything else from CGI will be passed as ISO-8859-1 and up to WSGI
>components/applications to explicitly worry about those if need to
>deal with them in special ways. Eg., REQUEST_URI, QUERY_STRING,
>HTTP_COOKIE, HTTP_REFERRER.

I'm not really thrilled with the idea of encoding different values 
differently, because it means that many more things for an 
implementer to remember to do correctly, but for which they receive 
no guidance or error messages if they get it wrong at first.

One big benefit of surrogateescape is that it maintains a certain 
symmetry between Python 2 and 3 wrt os.environ and CGI.  That is, you 
can in principle just throw a few extra keys into a copy of 
os.environ and have a valid wsgi environment.  (At least, in places 
where the system encoding is utf8, anyway.)  If you don't make it 
uniform across all CGI keys, then you have to write more a complex 
adapter, and at every level you need to remember what sort of key 
you're touching.



More information about the Web-SIG mailing list