I don't think that we can fix this issue. I suggest to close it as WONTFIX.
> sys.setrecursionlimit(3000)
While Python does its best to catch stack overflow, the C implementation of CPython can exhaust the stack memory (8 MB in Linux?) and then crash with a "stack overflow".
I suggest to rewrite your algorithm to reduce the maximum stack depth.
Or maybe try to find a way to extend the maximum size of the stack (is it possible without rebuilding Python?). See for example RLIMIT_STACK of the resource module on Unix.
> On linux x86-64 with python 3.6.3 and python 3.7.0a2+ I get a RecursionError: maximum recursion depth exceeded.
The exact memory usage depends on the Python version and maybe compiler flags. We reduce the stack usage in Python 3.7, search for "Stack consumption" in:
https://vstinner.github.io/contrib-cpython-2017q1.html |