Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
53d93adc
Commit
53d93adc
authored
Apr 19, 2003
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch #681152: Support escaped Unicode characters in classes. Fixes #612074.
Will backport to 2.2.
parent
910ae628
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
Lib/sre_parse.py
Lib/sre_parse.py
+1
-1
Lib/test/test_sre.py
Lib/test/test_sre.py
+4
-0
No files found.
Lib/sre_parse.py
View file @
53d93adc
...
...
@@ -254,7 +254,7 @@ def _class_escape(source, escape):
if len(escape) != 2:
raise error, "
bogus
escape
:
%
s
" % repr("
\\
" + escape)
return LITERAL, atoi(escape, 16) & 0xff
elif
str(escape[1:2])
in OCTDIGITS:
elif
escape[1:2]
in OCTDIGITS:
# octal escape (up to three digits)
while source.next in OCTDIGITS and len(escape) < 5:
escape = escape + source.get()
...
...
Lib/test/test_sre.py
View file @
53d93adc
...
...
@@ -96,6 +96,10 @@ test(r"""sre.match('.*?cd', 20000*'abc'+'de').end(0)""", 60001)
# non-simple '*?' still recurses and hits the recursion limit
test
(
r"""sre.search('(a|b)*?c', 10000*'ab'+'cd').end(0)"""
,
None
,
RuntimeError
)
# bug 612074
pat
=
u"["
+
sre
.
escape
(
u"
\
u2039
"
)
+
u"]"
test
(
r"""sre.compile(pat) and 1"""
,
1
,
None
)
if
verbose
:
print
'Running tests on sre.sub'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment