-
Notifications
You must be signed in to change notification settings - Fork 64
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
SystemError: AST constructor recursion depth mismatch #387
Comments
Might have to do with some specific expression in your template. Can you try and home in on which expression causes this – assuming that this is the case, that it can be isolated to a particular syntax? |
Unfortunately I'm just not sure where to start with that. It doesn't happen consistently, so I can't reproduce it locally. The traceback doesn't seem to point at any specific spot in a template:
Maybe it's a race condition? Should I try wrapping the render function in a mutex? |
Worth noting: I'm seeing tracebacks from all three |
If you can share some version of your template, that would be quite helpful – or if that is a problem, you can try and do something akin to a bisection, cutting away half of the template until it compiles. This should help you identify exactly the expression that is causing the problem. Or you could set up a breakpoint here:
That seems to be the spot where you could find the culprit. |
It doesn't happen consistently. Most of the time, the template will compile successfully, but a handful of times the exact same template will fail to compile. So far I'm unable to reproduce it locally. And I can't deploy those debugging steps into production. I wrapped the whole function in a mutex last night and so far no more errors, so it does seem to be a thread safety issue. |
Maybe same issue as #361. |
I tried Was able to reproduce locally:
|
This seems to be related to python/cpython#106905 – for now, I think we have to accept that Python 3.11.5 is not compatible with Chameleon. |
The fixed has been merged for 3.13, available in 3.13.0-alpha.2, but it still being backported for 3.11 and 3.12. |
After upgrading to Python 3.11 and Chameleon 4.2.0, I'm encounter errors seemingly at random when rendering my templates.
My rendering code is pretty straightforward. Each invocation instantiates a fresh
PageTemplate
I attempted to set
CHAMELEON_EAGER=1
as suggested in #361, but the errors still persist.The text was updated successfully, but these errors were encountered: