This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.smith
Recipients Leilei, ajoino, eric.smith
Date 2022-03-28.12:17:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1648469859.58.0.731474947752.issue47137@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2022-03-28 12:17:39eric.smithsetrecipients: + eric.smith, ajoino, Leilei
2022-03-28 12:17:39eric.smithsetmessageid: <1648469859.58.0.731474947752.issue47137@roundup.psfhosted.org>
2022-03-28 12:17:39eric.smithlinkissue47137 messages
2022-03-28 12:17:39eric.smithcreate