[Python-bugs-list] [ python-Bugs-610783 ] Lone surrogates cause bad .pyc files

noreply@sourceforge.net noreply@sourceforge.net
Tue, 24 Sep 2002 07:07:13 -0700


Bugs item #610783, was opened at 2002-09-17 20:47
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=610783&group_id=5470

Category: Unicode
Group: Python 2.2
>Status: Closed
>Resolution: Fixed
Priority: 8
Submitted By: Guido van Rossum (gvanrossum)
Assigned to: M.-A. Lemburg (lemburg)
Summary: Lone surrogates cause bad .pyc files

Initial Comment:
A Unicode literal in a .py file containing a lone
surrogate will cause a .pyc file to be written that
causes an exception in the UTF-8 decoder when it is loaded.

This is fixed in 2.3 but a fix is needed for 2.2 that
doesn't require the magic number to be changed.

A solution appears to be a UTF-8 decoder that accepts
the correct *and* the malformed version for such
Unicode strings.

(See python-dev discussion, subject "utf8 issue" in
Aug/Sep 2002.)

----------------------------------------------------------------------

>Comment By: M.-A. Lemburg (lemburg)
Date: 2002-09-24 14:07

Message:
Logged In: YES 
user_id=38388

Fixed in the 2.2 maintenance branch.

----------------------------------------------------------------------

Comment By: M.-A. Lemburg (lemburg)
Date: 2002-09-24 10:28

Message:
Logged In: YES 
user_id=38388

Working on it...

----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2002-09-23 16:21

Message:
Logged In: YES 
user_id=6380

This needs to be fixed in 2.2.2.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=610783&group_id=5470