[Python-bugs-list] [ python-Bugs-529104 ] broken error handling in unicode-escape

noreply@sourceforge.net noreply@sourceforge.net
Mon, 18 Mar 2002 04:56:30 -0800


Bugs item #529104, was opened at 2002-03-12 20:37
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=529104&group_id=5470

Category: Unicode
>Group: Python 2.3
Status: Open
>Resolution: Accepted
Priority: 7
Submitted By: Walter Dörwald (doerwalter)
Assigned to: Martin v. Löwis (loewis)
Summary: broken error handling in unicode-escape

Initial Comment:
Error handling for decoding unicode-escape encoded
string seems the be slightly broken:

Python 2.2 (#2, Mar  1 2002, 17:32:59) 
[GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-98)] on 
linux2
Type "help", "copyright", "credits" or "license" for 
more information.
>>> "\N{foo}xx".decode("unicode-
escape", "ignore")      
u'\x08xx'
>>> "\".decode("unicode-escape")                    
u'\\U082a74f8'

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

>Comment By: Michael Hudson (mwh)
Date: 2002-03-18 12:56

Message:
Logged In: YES 
user_id=6656

Applied in Objects/unicodeobject.c revision 2.124.6.6, thanks!

I also added the cases from the report to test_unicode.py
revision 1.47.6.1.

These changes will need to go onto the trunk, at some future
point.

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

Comment By: M.-A. Lemburg (lemburg)
Date: 2002-03-18 10:10

Message:
Logged In: YES 
user_id=38388

Assigned to Martin. I don't have time for this the next two weeks.

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

Comment By: Martin v. Löwis (loewis)
Date: 2002-03-17 22:44

Message:
Logged In: YES 
user_id=21627

Attached is a patch that fixes the two bugs.

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

Comment By: Martin v. Löwis (loewis)
Date: 2002-03-17 22:08

Message:
Logged In: YES 
user_id=21627

This falls in the "doctor, it hurts when I do this"
category, and it is not a regression over 2.1.x, so I don't
think it is critical to fix for 2.2.

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

Comment By: Michael Hudson (mwh)
Date: 2002-03-16 17:43

Message:
Logged In: YES 
user_id=6656

Agree that looks nasty.  Any chance of a quick fix from Marc
or Martin?

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

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