summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-08-03 16:26:33 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-08-03 16:26:33 (GMT)
commit3ade66c203cda06227c5ac0c50857f9b7eb71c87 (patch)
treeddbb3cc334f868270df7ca9115b0e6549eeefe6d /Lib
parente8e312142e69647de9f66b89d7cedcd3ea05ae2c (diff)
downloadcpython-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.py10
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