call stack is not deep enough (Cython)
See original GitHub issueHi @Delgan
When using loguru 0.2.5 inside python script it works as expected, but when i compile this file to an executable using Cython i get this error and program terminates : call stack is not deep enough
More info of the error :
Traceback (most recent call last):
File "test_layer.py", line 66, in init test_layer
logger.warning('just test')
File "/usr/local/lib/python3.5/dist-packages/loguru/_logger.py", line 1406, in log_function
frame = get_frame(_self._depth + 1)
ValueError: call stack is not deep enough
Do you have any idea why ?
I tried increasing the execution depth limit inside the script that i import loguru by using sys.setrecursionlimit(3000) but still issue remains…
OS: raspbian stretch lite Cython-0.29.7
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
call stack is not deep enough" when calling IPython.embed ...
A solution is to insert a new frame created with PyFrame_New, but it is outside the documented Python C API. #include <Python.h> #include ......
Read more >call stack is not deep enough when import matplotlib.pyplot as ...
Works fine here. Looks like a python/matplotlib installation error. Does it work from the python prompt?
Read more >Developers - call stack is not deep enough (Cython) - - Bountysource
Hi @Delgan. When using loguru 0.2.5 inside python script it works as expected, but when i compile this file to an executable using...
Read more >[Solved] Many occurrences of error message '(call stack is not ...
I get a lot of error messages '(call stack is not deep enough)' while using FreeCAD 0.19. This looks like a bug to...
Read more >A breakdown of Cython basics - CallMiner
Python already has the ability to call external C/C++ code from Python. Cython ... And with libraries like numpy, Python's performance can be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@djsakisd As
.opt()
actually returns alogger
object, you can addlogger = logger.opt(depth=-1)
at the start of your file, and then use this newlogger
without needing to callopt()
every time.I will investigate this issue, hopefully you will not even need this workaround in the next version. 👍
Hi @djsakisd.
This is not related to the recursion limit, but to
sys._getframe()
which tries to access frame of the call site to extract logging information. Typically, this error indicates thatloguru
tried to access a frame which does not exist.You may play with the
depth
option to see if some negative values fixes the problem:On my side, I will try to reproduce the error, I actually never tested Cython, so I’m not too surprised there is some incompatibilities dealing with stack frames.