[Web-SIG] WSGI for Python 3

chris.dent at gmail.com chris.dent at gmail.com
Sat Jul 17 14:30:34 CEST 2010


On Fri, 16 Jul 2010, P.J. Eby wrote:

> At 02:28 PM 7/16/2010 -0500, Ian Bicking wrote:
> There should be one, and preferably *only* one, obvious way to do it.
>
> And given that HTTP is inherently a bunch of bytes, bytes is the one obvious 
> way.

I think this makes sense. The thing which is assembling the WSGI
environment should do bytes and things further down the stack can
deal with it as they like. This aligns well with how I like to think
about such stuff: bytes on the outside, unicode on the inside.

Given that app and frameworks developers can throw whatever keys
they like back into the environment, they can cope as they like.[1]

What would be horrible is if there need to be multiple coping
strategies. Better to be able to say, "Oh it doesn't work? Try this
way to cope: remember it is bytes."

However, unless I'm misreading the thread, the bytes issue isn't
really the bone of contention. People seem okay with bytes as long
as specifc points of pain are addressed, such as:

* What's my PATH_INFO and SCRIPT_NAME?
* This server, which hosts, but is not, the WSGI environment builder
   doesn't play well with this model.
* Some others I can't remember now.

It seems then that perhaps a way forward is to say: Okay, it's gonna
be bytes. Now, given that, how do we deal with these other issues,
which perhaps can be recast and encapsulated to be considered
orthogonal to the bytes/not-bytes debate.

Because we _know_ that any choice is going to come with costs, but
as things have dragged on, the lack of choice thus far is starting
to have as much of a cost as the costs that are wanting to be
resolved.

[1] I not expecting or hoping for  porting/migrating to Python 3 to
be simple/automatic/easy, but perhaps I'm cruel.
-- 
Chris Dent                      http://burningchrome.com/~cdent/
                               [...]


More information about the Web-SIG mailing list