Closed ido-ran closed 4 years ago
This is a known issue...
We already tried some approaches and still haven't been able to come up with a good solution to do that in the general case, so, for now, you're required to manually ask for non-python started threads to be traced.
To do that you can use the following api:
import debugpy
debugpy.debug_this_thread()
Thanks @fabioz. I've added this call into my pyx
file and that is solving the problem in VS Code.
I actually need to make it work in PyCharm as well, using this snippet seems to cover all bases as both PyCharm and VS Code are using pydev under the hood:
try:
import pydevd
pydevd.settrace(suspend=False)
except:
# ignore if debugger is not available
pass
Yeap, using the pydevd api directly should also work for debugpy ;)
p.s.: I'm closing as this is a known issue which is being tracked elsewhere.
I have first open this bug in https://github.com/microsoft/vscode-python/issues/14098 - but maybe here it's more appropriate.
Environment data
python.languageServer
setting: JediExpected behaviour
The debugger will break on the breakpoint set in VS Code.
Actual behaviour
The debugger does not break on the breakpoint set.
Steps to reproduce:
create-venv.sh
once to create venvbuild_thrd.sh
to build Cyton extensiontest_threading.py
in VS Codeprint
statement inhandler
function