diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-08-03 16:22:28 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-08-03 16:22:28 (GMT) |
commit | b94f61b6fb4cd36aa1bcb0b7636c65ca0a04019d (patch) | |
tree | 3337c0acf60d6234220526b4b5cb6dd13dff71b1 /Lib | |
parent | fb0ffa12fc79dfa4f97a61d9c32995551f995c1d (diff) | |
parent | 1f35ae0a3c7dc2d7709f60e62cb4d0aa7aeae490 (diff) | |
download | cpython-b94f61b6fb4cd36aa1bcb0b7636c65ca0a04019d.zip cpython-b94f61b6fb4cd36aa1bcb0b7636c65ca0a04019d.tar.gz cpython-b94f61b6fb4cd36aa1bcb0b7636c65ca0a04019d.tar.bz2 |
Issue #17998: Fix an internal error in regular expression engine.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_re.py | 10 |
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 |