[Web-SIG] String Types in WSGI [Graham's WSGI for py3]

René Dudfield renesd at gmail.com
Sat Sep 19 12:33:06 CEST 2009


On Fri, Sep 18, 2009 at 12:55 PM, Graham Dumpleton
<graham.dumpleton at gmail.com> wrote:
> What I would like to hear is PJE (who tends towards #3) and Robert
> Brewer (who tends towards #4). Can you guys give counter explanations
> as to why there arguments for bytes isn't valid. Ian, I don't think
> you have yet expressed your leaning, but would like to here your point
> as well.
>
> On top of the issues above, Armin believes 2to3 gives better results
> where bytes everywhere interpretation is used. Has anyone else
> actually tried 2to3 and have the experience with it?
>
> Graham


Here's a small wsgi server converted in the other thread.

I've also applied 2to3 to it so you can see what it does.  Below are
links to diffs as well.

Note, this doesn't show the following things converted with 2to3:
    - wsgi application.
    - an application from a framework layered on top(eg cherrypy).
    - wsgi middleware.

sneaky.py
    - original python 2.x wsgi 1.0 server.
    http://pastebin.com/f5c2cdd3b
sneaky3.py
    - conversion done by hand.
    http://pastebin.com/f7ae33d81
sneaky3_from2to3.py
    - conversion from 2to3 (python 3.1 version of the script)
    http://pastebin.com/f62a7d83a



(diffs for your comparison).

sneaky_2to3.diff
    - a diff from sneaky.py and the 2to3 tool applied.
    http://pastebin.com/f6d0430fa

sneaky_sneaky3.diff
    - a diff from sneaky.py and sneak3.py
    http://pastebin.com/f23cadbb0




cu,


More information about the Web-SIG mailing list