[Patches] [ python-Patches-681152 ] Tiny patch for bug 612074: sre unicode escapes

SourceForge.net noreply@sourceforge.net
Wed, 05 Feb 2003 11:23:54 -0800


Patches item #681152, was opened at 2003-02-05 10:23
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=681152&group_id=5470

Category: Library (Lib)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Greg Chapman (glchapman)
Assigned to: Nobody/Anonymous (nobody)
Summary: Tiny patch for bug 612074: sre unicode escapes

Initial Comment:
Bug report 612074 points out that this raises an 
exception:

import re 
a = unichr(0x2039) 
b = u"["+re.escape(a)+u"]" 
re.compile(b) 

The exception is raised by an unnecessary call to str in 
sre_parse.py (in the function _class_escape); str
(u'\u2039') raises a UnicodeError.  The call is 
unnecessary because (for example) u'1' == '1', so no 
type conversion is necessary to test for membership in 
OCTDIGITS.


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

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