microsoft / microsoft/vscode-python-debugger

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

Đang mở
#544 8 bình luận 2 reaction 1 người được giao Xem trên GitHub

@eleanorjboyd đang làm issue này rồi.

Từ ngày 14/1/2025.

triage-needed
Ngôn ngữ chính
TypeScript
Star
181
Fork
126
Merge trung bình
2 ngày 3 giờ
Pull request đã merge (30 ngày)
3

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.