Message254042
| Author |
serhiy.storchaka |
| Recipients |
The Compiler, effbot, ezio.melotti, mrabarnett, pitrou, serhiy.storchaka |
| Date |
2015年11月04日.09:27:11 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1446629232.01.0.273591339993.issue25550@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
This isn't a bug, this is a limitation of the implementation. Regular expression parser is recursive and Python has a limit for recursion depth. You can increase this limit if needed.
>>> import sys, re
>>> sys.setrecursionlimit(2000)
>>> re.compile('(' * 500)
Traceback (most recent call last):
File "/home/serhiy/py/cpython/Lib/sre_parse.py", line 437, in _parse_sub
itemsappend(_parse(source, state))
File "/home/serhiy/py/cpython/Lib/sre_parse.py", line 778, in _parse
p = _parse_sub(source, state)
File "/home/serhiy/py/cpython/Lib/sre_parse.py", line 437, in _parse_sub
itemsappend(_parse(source, state))
...
File "/home/serhiy/py/cpython/Lib/sre_parse.py", line 778, in _parse
p = _parse_sub(source, state)
File "/home/serhiy/py/cpython/Lib/sre_parse.py", line 437, in _parse_sub
itemsappend(_parse(source, state))
File "/home/serhiy/py/cpython/Lib/sre_parse.py", line 781, in _parse
source.tell() - start)
sre_constants.error: missing ), unterminated subpattern at position 499 |
|