Skip to content

Make debugger gevent compatible #127

Closed
@DonJayamanne

Description

@DonJayamanne

From @underyx on June 5, 2017 10:27

Environment data

VS Code version: 1.12.2
Python Extension version: 0.6.4
Python Version: 2.7.13
OS and version: macOS Sierra

Actual behavior

Running apps that use gevent/eventlet/greenlet/green threads/etc. with the debugger active causes the app to just freeze early on. This is the same behavior that I see when I run the same app with the PyCharm debugger with its 'Gevent compatible' switch turned off.

Expected behavior

They should work just like synchronous apps. In PyCharm, there's an option for this called 'Gevent compatible' on the debugger settings page, that sounds like a reasonable thing to have here as well.

Steps to reproduce:

  1. Take any Python application.
  2. pip install gevent.
  3. Add from gevent import monkey; monkey.patch_all() in the app's __init__.py.
  4. Try to run it with the debugger.

Settings

Your launch.json (if dealing with debugger issues):

        {
            "name": "my api",
            "type": "python",
            "request": "launch",
            "stopOnEntry": false,
            "pythonPath": "${config:python.pythonPath}",
            "program": "env/bin/gunicorn",
            "args": [
                "--config=.misc/gunicorn_config.py",
                "--reload",
                "myapi"
            ],
            "cwd": "${workspaceRoot}",
            "env": {},
            "envFile": "${workspaceRoot}/.env",
            "debugOptions": [
                "WaitOnAbnormalExit",
                "WaitOnNormalExit",
                "RedirectOutput"
            ]
        },
``

Your settings.json:   
```json
{
    "python.pythonPath": "env/bin/python"
}

Logs

Output from Python output panel

(empty)

Output from Console window (Help->Developer Tools menu)

(empty)

Edit: oh wow, 1000! 🎊

Copied from original issue: DonJayamanne/pythonVSCode#1000

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions