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

noreply@sourceforge.net noreply@sourceforge.net
Thu, 21 Mar 2002 00:56:31 -0800


Bugs item #529104, was opened at 2002-03-12 21: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: Closed
>Resolution: Fixed
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: Martin v. L÷wis (loewis)
Date: 2002-03-21 09:56

Message:
Logged In: YES 
user_id=21627

Forwarded to HEAD as unicodeobject.c 2.131, test_unicode.py
1.50.

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

Comment By: Michael Hudson (mwh)
Date: 2002-03-18 13: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 11: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 23: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 23: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 18: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