[Web-SIG] Clarifications on Python 3.0 and WSGI.

Ian Bicking ianb at colorstudy.com
Tue Mar 25 17:41:40 CET 2008


Phillip J. Eby wrote:
> At 11:04 AM 3/25/2008 -0500, Ian Bicking wrote:
>> Phillip J. Eby wrote:
>>> It says that in versions of Python where 'str is unicode' (i.e. 
>>> Jython, IronPython, and Python 3000), then the specification should 
>>> be read to define "string" as a unicode string whose characters can 
>>> be expressed in latin-1.
>>> Really, adding support for bytes is the stretch here.  In fact, I'd 
>>> almost go so far as to say the heck with bytes support except for the 
>>> response body.  I could easily consider headers to be text, instead.
>>
>> Latin-1?  How is this supposed to work at all?
> 
> Latin-1 is the encoding that can allow a unicode string to losslessly 
> encode arbitrary bytes.  And that's how these things are handled (or 
> should be handled, per the spec) in Jython and IronPython today.
> 
> In any case I only said I'd *almost* go so far as to say headers are 
> text.  :)

Are you proposing that we use a Latin-1 encoded string to hold bytes?

Isn't that kind of a step backwards in keeping unicode and text straight?

   Ian


More information about the Web-SIG mailing list