[Web-SIG] String Types in WSGI [Graham's WSGI for py3]
armin.ronacher at active-4.com
Fri Sep 18 13:58:58 CEST 2009
Graham Dumpleton schrieb:
> 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?
You slightly misquoted me. I said that 2to3 gives good results on high
level transformations (eg, a django app between 2 and 3) because both
"foo" and u"foo" becomes "foo". Werkzeug, WebOb, Django all use unicode
by default, so the application will not notice any changes.
That would not change if we would have unicode in the WSGI dict and the
framework would be changed to treat it properly and do a encode/decode
dance if necessary.
The reason I brought it up is that 2to3 does not work at all on the raw
WSGI layer currently because it converts bytes to unicode which in my
opinion is just wrong.
More information about the Web-SIG