microsoft / microsoft/vscode-python-debugger

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

Aberta
#544 8 comentários 2 reações 1 responsável Ver no GitHub

@eleanorjboyd já está trabalhando nisso.

Desde 14/1/2025.

triage-needed
Linguagem predominante
TypeScript
Estrelas
181
Forks
126
Merge médio
2d 3h
PRs com merge (30d)
3

Descrição

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.

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.