Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step Over, Step Into, and Step Out not working when debugging Flask app served locally using gunicorn #544

Open
jdwestwood opened this issue Jan 1, 2025 · 1 comment
Labels
triage-needed Needs assignment to the proper sub-team

Comments

@jdwestwood
Copy link

Version: 1.96.2 (user setup)
Commit: fabdb6a30b49f79a7aba0f2ad9df9b399473380f
Date: 2024-12-19T10:22:47.216Z
Electron: 32.2.6
ElectronBuildId: 10629634
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Windows_NT x64 10.0.19045

Running in Win10/WSL2 with Python 3.12.
VSCode Python Debugger v2024.12.0 and later, up though the current pre-release v2024.15.2024121701.

In launch.json, I have the following (simplified) config for debugging my Flask app using gunicorn[gevent] v23.0.0 (the latest version) to serve it locally:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch gunicorn",
            "type": "debugpy",
            "request": "launch",
            "python": "/path/to/python/venv/bin/python3.12",
            "program": "/path/to/python/venv/bin/gunicorn",
            "cwd": "${workspaceFolder:flask_app}",
            "gevent": true,
            "args": ["startup:app",
                     "--bind=localhost:8080",
                     "--workers=1",
                     "--worker-class=gevent"],
        },
}

A simplified version of the entry-point file startup.py that reproduces the bug is:

# Set a breakpoint 1 here.
a = 1

# Step Over or Step In to here.
b = 2

# Set breakpoint 2 here.
c = 3

# For the purpose of illustrating the bug, these lines can be commented out.
# from flask import Flask
# app = Flask('Flask_App')

In Python Debugger v2024.10.0, when I launch "Launch gunicorn" everything works as expected: after hitting breakpoint 1, I can "Step Over" or "Step In" to b = 2.

In Python Debugger v2024.12.0 and subsequent releases, execution stops as expected at breakpoint 1, but clicking "Step Over" or "Step In" causes execution to resume until breakpoint 2 is hit.

For the time being as a workaround, I have pinned Python Debugger at v2024.10.0.

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jan 1, 2025
@escopeland
Copy link

Using Flask's development server instead of gunicorn leads to the same problem. Reverting to Python Debugger v2024.10.0 works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants