gevent monkey-patching and breakpoints

Viewed 6000

I have been playing with Gevent, and I like it a lot. However I have run into a problem. Breakpoint are not being hit, and debugging doesn't work (using both Visual Studio Python Tools and Eclipse PyDev). This happens after monkey.patch_all() is called.

This is a big problem for me, and unfortunately this is a blocker for the use of gevent. I have found a few threads that seem to indicate that gevent breaks debugging, but I would imagine there is a solution for that.

Does anyone know how to make debugging and breakpoints work with gevent and monkey patching?

5 Answers

While debugging in VS Code,

I was getting this error:

It seems that the gevent monkey-patching is being used. Please set an environment variable with: GEVENT_SUPPORT=True to enable gevent support in the debugger.

To do this, in the debug launch.json settings, I set the following:

"env": {
    "GEVENT_SUPPORT": "True"
},
Related