summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-08-03 16:18:38 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-08-03 16:18:38 (GMT)
commit1f35ae0a3c7dc2d7709f60e62cb4d0aa7aeae490 (patch)
treeda53139331ad9a0e3b0c059815c195f835da4b2d /Lib
parent1dfb9180a736c9033730ce05db696ee32c5a3d1c (diff)
downloadcpython-1f35ae0a3c7dc2d7709f60e62cb4d0aa7aeae490.zip
cpython-1f35ae0a3c7dc2d7709f60e62cb4d0aa7aeae490.tar.gz
cpython-1f35ae0a3c7dc2d7709f60e62cb4d0aa7aeae490.tar.bz2
Issue #17998: Fix an internal error in regular expression engine.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_re.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index 8bc74a2..c84d4ed 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -1040,6 +1040,16 @@ class ReTests(unittest.TestCase):
with self.assertRaisesRegex(sre_constants.error, '\?foo'):
re.compile('(?P<?foo>)')
+ def test_issue17998(self):
+ for reps in '*', '+', '?', '{1}':
+ for mod in '', '?':
+ pattern = '.' + reps + mod + 'yz'
+ self.assertEqual(re.compile(pattern, re.S).findall('xyz'),
+ ['xyz'], msg=pattern)
+ pattern = pattern.encode()
+ self.assertEqual(re.compile(pattern, re.S).findall(b'xyz'),
+ [b'xyz'], msg=pattern)
+
def run_re_tests():
from test.re_tests import tests, SUCCEED, FAIL, SYNTAX_ERROR