Message416162
A simpler reproducer is:
codeop.compile_command('[' * 100)
Verified I get MemoryError on cygwin PYthon 3.8.12. A length of 99 does not show a problem.
On Windows 3.11.0a5+, I get:
>>> codeop.compile_command('[' * 201)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\home\eric\local\python\cpython\Lib\codeop.py", line 107, in compile_command
return _maybe_compile(_compile, source, filename, symbol)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\home\eric\local\python\cpython\Lib\codeop.py", line 70, in _maybe_compile
compiler(source + "\n", filename, symbol)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\home\eric\local\python\cpython\Lib\codeop.py", line 86, in _compile
return compile(source, filename, symbol, PyCF_DONT_IMPLY_DEDENT | PyCF_ALLOW_INCOMPLETE_INPUT)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<input>", line 1
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
^
SyntaxError: too many nested parentheses
A length of 200 seems to work correctly.
So it looks like this was fixed somewhere along the line, I'm guessing with the PEG parser. I suspect backporting the fix to older versions won't be possible. |
|
Date |
User |
Action |
Args |
2022-03-28 12:17:39 | eric.smith | set | recipients:
+ eric.smith, ajoino, Leilei |
2022-03-28 12:17:39 | eric.smith | set | messageid: <1648469859.58.0.731474947752.issue47137@roundup.psfhosted.org> |
2022-03-28 12:17:39 | eric.smith | link | issue47137 messages |
2022-03-28 12:17:39 | eric.smith | create | |
|