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 ait
Recipients ait, benjamin.peterson, netcaf
Date 2018-06-25.09:12:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1529917965.91.0.56676864532.issue3971@psf.upfronthosting.co.za>
In-reply-to
Content
Also affected, a code generator produced deeply nested code with the structure depicted below and then crashed:

#!/usr/bin/python2 -BEsStt
A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A([A(None)])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])])


What would be the maximal nesting depth a generator can always expect to be compiled successfully on Python 2.7 and 3.5 on? Are there any other similar restrictions that need to be considered when writing a code generator? Or is generating code that way not the preferred solution anyway - the code generator should generate e.g. compiled binary Python code immediately?

Note: in the end the exact same logic code will run as Python process, it is only about how it is loaded into the Python interpreter. Different from the code example in the bug create message, code with similar properties to the one from this example is generated to evaluate a mathematical model, thus not that random and meaningless compared to the putative fuzzer output from the first note.
History
Date User Action Args
2018-06-25 09:12:45aitsetrecipients: + ait, benjamin.peterson, netcaf
2018-06-25 09:12:45aitsetmessageid: <1529917965.91.0.56676864532.issue3971@psf.upfronthosting.co.za>
2018-06-25 09:12:45aitlinkissue3971 messages
2018-06-25 09:12:45aitcreate