[Web-SIG] WSGI for Python 3

Alan Kennedy alan at xhaus.com
Sat Jul 17 16:29:26 CEST 2010

[PJ Eby]
> IOW, the bytes/string discussion on Python-dev has kind of led me to realize
> that we might just as well make the *entire* stack bytes (incoming and
> outgoing headers *and* streams), and rewrite that bit in PEP 333 about using
> str on "Python 3000" to say we go with bytes on Python 3+ for everything
> that's a str in today's WSGI.
> Or, to put it another way, if I knew then what I know *now*, I think I'd
> have written the PEP the other way around, such that the use of 'str' in
> WSGI would be a substitute for the future 'bytes' type, rather than viewing
> some byte strings as a forward-compatible substitute for Py3K unicode
> strings.
> Of course, this would be a WSGI 2 change, but IMO we're better off making a
> clean break with backward compatibility here anyway, rather than having
> conditionals.  Also, going with bytes everywhere means we don't have to
> rename SCRIPT_NAME and PATH_INFO, which in turn avoids deeper rewrites being
> required in today's apps.


> (Hm.  Although actually, I suppose we *could* just borrow the time machine
> and pretend that WSGI called for "byte-strings everywhere" all along...)



More information about the Web-SIG mailing list