diferences between 22 and python 23

Mike C. Fletcher mcfletch at rogers.com
Wed Dec 3 21:34:21 CET 2003

Peter Hansen wrote:

>"Mike C. Fletcher" wrote:

>>Which doesn't actually mention the breakage of code that results.  True,
>>theoretically the code was never valid, but *lots* of people used 8-bit
>>encodings quite happily with earlier versions and do find their code
>>breaking in 2.3 because of this.
>Wait a sec... are you telling me that my code, which has strings containing
>binary data (which I believe has *always* been permitted), and which from
>time to time might, say, produce an error traceback containing the content
>from one such string and write it to a log file, then continue processing
>safely, will now fail with an ugly crash because I haven't changed it to
>specify a default encoding? (!!!)
Yes, though as Fredrik points out, not just yet.  For now you'll get a 
DeprecationWarning with 2.3.

>I've been watching this "value XX with high bit set was never a valid 7-bit 
>ASCII" discussion with only one eye for quite some time now, somewhat curious
>why so many people were having troubles.  I assume it was merely that they
>were using *names* that contained non-ASCII characters, in their source code.
>Are you saying that this change is actually breaking code that happens to
>have these perfectly valid binary strings stored in string constants?
AFAIK, that's the plan.  IIRC, rationale was that there would be some 
other type for 8-bit data, while all "normal" strings would become 
Unicode strings.  Of course, I've been known to catch fragments of 
conversations and read too much into them.  For all I know, it may only 
be unicode literals that will be affected.  Though I know some of my 
users were reporting DeprecationWarnings from resourcepackage, which 
doesn't do any Unicode at all (just stuffs binary data into string 

>I'm very unimpressed with this decision if that's the case.
Doesn't make me ecstatic, either, as I like the simple 8-bit-clean 
string type.  But maybe we'll luck out and it will turn out that I'm all 
wet on this one :) .


  Mike C. Fletcher
  Designer, VR Plumber, Coder

More information about the Python-list mailing list