-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-120108: Fix deepcopying of AST trees with .parent attributes #120114
Conversation
JelleZijlstra
commented
Jun 5, 2024
•
edited by bedevere-app
bot
Loading
edited by bedevere-app
bot
- Issue: RecursionError during copy.deepcopy of an ast-tree with parent references #120108
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments. I'll check them again once I am on my PC.
for child in ast.iter_child_nodes(node): | ||
child.parent = node | ||
try: | ||
with support.infinite_recursion(200): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe bisect the exact recursion limit being needed so that we exactly know whether something changed or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should guarantee the exact number of stack frames needed for this test; future changes may mean we need slightly more or fewer. The point of the test is to ensure the number of stack frames does not grow to an unreasonable level.
Merging this as it's been a few weeks and I want this to go into the next 3.13 beta. |
🤖 New build scheduled with the buildbot fleet by @JelleZijlstra for commit 00e1e3e 🤖 If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again. |
Thanks @JelleZijlstra for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Sorry, @JelleZijlstra, I could not cleanly backport this to
|
…ributes (pythonGH-120114) (cherry picked from commit 42b2c9d) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
…ributes (pythonGH-120114) (cherry picked from commit 42b2c9d) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
GH-121000 is a backport of this pull request to the 3.13 branch. |