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

noreply@sourceforge.net noreply@sourceforge.net
Sun, 17 Mar 2002 14:08:10 -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.2.1 candidate
Status: Open
Resolution: None
Priority: 7
Submitted By: Walter Dörwald (doerwalter)
Assigned to: M.-A. Lemburg (lemburg)
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-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