diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2013-08-03 16:26:33 (GMT) |
|---|---|---|
| committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-08-03 16:26:33 (GMT) |
| commit | 3ade66c203cda06227c5ac0c50857f9b7eb71c87 (patch) | |
| tree | ddbb3cc334f868270df7ca9115b0e6549eeefe6d /Lib | |
| parent | e8e312142e69647de9f66b89d7cedcd3ea05ae2c (diff) | |
| download | cpython-3ade66c203cda06227c5ac0c50857f9b7eb71c87.zip cpython-3ade66c203cda06227c5ac0c50857f9b7eb71c87.tar.gz cpython-3ade66c203cda06227c5ac0c50857f9b7eb71c87.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 18a81a2..2be5f5c 100644 --- a/Lib/test/test_re.py +++ b/Lib/test/test_re.py @@ -897,6 +897,16 @@ class ReTests(unittest.TestCase): with self.assertRaisesRegexp(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 |
