When a python interpreter gets killed with a signal, it typically produces output like:
File "~/anaconda/envs/py34/lib/python3.4/site-packages/skimage/feature/orb.py", line 313, in detect_and_extract
orientations)
File "~/anaconda/envs/py34/lib/python3.4/site-packages/skimage/feature/orb.py", line 218, in _extract_octave
descriptors = _orb_loop(octave_image, keypoints, orientations)
File "skimage/feature/orb_cy.pyx", line 56, in skimage.feature.orb_cy._orb_loop (skimage/feature/orb_cy.c:2276)
File "~/anaconda/envs/py34/lib/python3.4/site-packages/numpy/core/numeric.py", line 394, in asarray
def asarray(a, dtype=None, order=None):
KeyboardInterrupt
Is there a way to produce output like that as part of pausing, rather than permanently stopping, the running process? It would be cool to be able to inspect running python programs like that, without slowing them down by management of a debugger.
To people reading this question to see whether it relates to their own technical issue:
This popular page explains how to programmatically get traceback output without halting. My question asked about whether python interpreters have such code built into them (so that one could give a signal like kill -n
for some n
in order to get traceback output without stopping the process), so that one does not have to explicitly add that to their program. It appears that python interpreters do not have that behavior.