This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Tiny patch for bug 612074: sre unicode escapes
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: effbot Nosy List: effbot, glchapman, loewis
Priority: normal Keywords: patch

Created on 2003-02-05 19:23 by glchapman, last changed 2022-04-10 16:06 by admin. This issue is now closed.

Messages (2)
msg42684 - (view) Author: Greg Chapman (glchapman) Date: 2003-02-05 19:23
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.
msg42685 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-04-19 08:40
Logged In: YES 
user_id=21627

Thanks for the patch. Committed as

sre_parse.py 1.57
test_sre.py 1.40
sre_parse.py 1.51.6.1
test_sre.py 1.35.6.1
History
Date User Action Args
2022-04-10 16:06:34adminsetgithub: 37917
2003-02-05 19:23:54glchapmancreate