Green threads (eventlet) and debugger support
I am evaluating PyCharm and have a question about debugging and green threads. The code I'm working with uses the eventlet library. Hitting a breakpoint yields a "cannot switch to a different thread" error as the happens on a different thread. Given the popularity of green threads I suspect that this scenario must be supported, and am looking for information about how to deal with it in the debugger. Thank you,
-D
Please sign in to leave a comment.
I am also facing the same issue and like to know if there is any solution to this. Not knowing much about how this works, I have tried putting the following in the $PYDEV/helpers/pydev/pydevd.py
try:
from gevent import monkey
print("starting monkey patching>>>>>")
monkey.patch_all()
print("patched all")
except ImportError as inst:
print ("EXCEPTION>>>>>>>>>>>>While monkey patching pydevd")
print(inst)
pass
We have investigated this issue, and unfortunately we haven't been able to make it work. It looks like the only reasonable solution for debugging gevent applications is to use Wing IDE, which has a debugger runtime written in C and not affected by gevent's monkey-patching.