[Web-SIG] Python 3.0 and WSGI 1.0.

James Y Knight foom at fuhm.net
Sat May 9 00:05:38 CEST 2009


On May 8, 2009, at 6:00 PM, P.J. Eby wrote:
> Compatibility sometimes demands we do silly things.  Personally, I  
> think it's kind of silly that Python 3 files return incompatible  
> data types depending on what mode you open them in, but there's not  
> a whole lot we can do about that.
>
> Meanwhile, existing WSGI code ported to Python 3 is going to yield  
> strings until/unless manually converted; AFAIK 2to3 has no way to  
> automatically detect WSGI-ness and convert your strings to bytes.

Yes, 2to3 doesn't work for any non-trivial app... You have this same  
exact issue with straight-up sockets! Why should WSGI be the odd-man- 
out here and accept strings when you should've passed a bytestring,  
when nothing else in python 3 does that, and has the exact same  
backwards-compat problems?

James


More information about the Web-SIG mailing list