[Web-SIG] WSGI, Python 3 and Unicode

Guido van Rossum guido at python.org
Fri Dec 7 04:51:37 CET 2007

On Dec 6, 2007 5:45 PM, Phillip J. Eby <pje at telecommunity.com> wrote:
> At 04:27 PM 12/6/2007 -0800, Guido van Rossum wrote:
> >You might want to look at how the unittests for wsgiref manage to pass
> >in Py3k though. ;-)
> Unless they've been changed, I'd assume it's because they work with
> strings exclusively, and never do any encoding or decoding (which is
> outside WSGI's scope, at least in the current version).

Indeed, that seems mostly to be the case. But this means that any
application that wants to emit characters outside Latin-1 cannot just
encode() those characters, since the encode() output will be bytes and
those will not be accepted by the WSGI API. OTOH sending non-Latin-1
characters without encoding would violate the standard. So something
needs to give...

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Web-SIG mailing list