[Web-SIG] Python 3.0 and WSGI 1.0.

Tres Seaver tseaver at palladion.com
Thu Apr 2 20:33:08 CEST 2009

Hash: SHA1

James Y Knight wrote:

> I think you're saying you agree with exactly the opposite of what I
> meant. The server/gateway (aka apache mod_wsgi) *must not* be required
> to handle RFC2047 decoding. Only the application (or a header parsing
> library that the application uses) can possibly handle this properly.

I don't understand why:  if RFC2047 values are being passed as HTTP
headers, then surely the server has enough information to decode them,
and to ensure that they are re-encoded into the same encoding as all
other WSGI enviornment variables (under Python 2.x).

Ensuring that the enviornment variables are uniformly encoded (or
decoded to unicode, in Python 3.x) seems like it *must* be the server's
responsiblity:  only the server can know how some values (e.g., those
derived from filesystem paths, or its config file) are encoded.  Moving
that responsibility to the application just means that it won't be met,
because the application won't have enough information to do the job.

> That's why I think it should not be mentioned at all in the WSGI
> requirements for the server.
> Furthermore, although they certainly can if they want, I'd recommend
> that no applications actually bother with doing such decoding, since
> RFC2047 words in http headers are essentially never used.

In that case, it would be moot whether the server or the application
does (not) do the decoding.

- --
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


More information about the Web-SIG mailing list