[Web-SIG] Proposal to remove SCRIPT_NAME/PATH_INFO

And Clover and-py at doxdesk.com
Wed Sep 23 13:12:36 CEST 2009


Ian Bicking wrote:

> I propose we switch primarily to "native" strings: str on both Python 2 and
> 3.

Fine.

> wsgi.input remains byte-oriented, as does the response app_iter.

Good.

> These both form the original path.  It is not URL decoded, so it should be
> ASCII.

Great! BUT.

Undecoded script_name/path_info *cannot* be provided by some gateways: 
primarily, but not only, CGI.

Such a gateway can reconstruct what it thinks the undecoded versions 
should have been, but this is not reliably accurate. I would like a way 
(eg. a flag) for the gateway or server to specify to the application 
that script_name/path_info are potentially inaccurate. Then the 
application can react by avoiding IRI (and %2F, though arguably that 
should be avoided anyway).

> This sends different text, but is highly preferable.

Yes. All schemes to send non-ASCII in cookies require sending different 
text; URL-encoding is a common choice of ad-hoc wrapping. I don't think 
WSGI has to worry too much about explaining this, it's a known hazard of 
the web in general. It doesn't work in any other environment, so nobody 
should be expecting it to work in WSGI.

> What happens if you give unicode text in the response headers that cannot be
> encoded as Latin1?

UnicodeEncodeError.

> Should some things be unicode on Python 2?

Don't think so.

-- 
And Clover
mailto:and at doxdesk.com
http://www.doxdesk.com/


-- 
And Clover
mailto:and at doxdesk.com
http://www.doxdesk.com/



More information about the Web-SIG mailing list