VS Code Debugger Freezes When Using wrap_wsgi_app with debugpy
还没有人认领这个 Issue。
评估
调研方向
从示例项目的 main.py 开始,重点查看第 5、6 和 8 行,并在 Python 3.13 下启动其包含的“wsgiref”调试配置。使用 curl 重现断点冻结,然后跟踪 wrap_wsgi_app(app) 与 debugpy 之间的交互。当断点聚焦到源代码行、调试器控件能够响应,并且恢复执行后 HTTP 请求完成时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Environment data
- debugpy version: XXX (run
import debugpy; print(debugpy.__version__)if uncertain)1.8.13 - OS and version:
- Python version (& distribution if applicable, e.g. Anaconda):
Virtualenv
Python: 3.13.4
Implementation: CPython
Platform: linux
OS: posix
Python: 3.13.4
Path: /home/tony/.pyenv/versions/3.13.4
Executable: /home/tony/.pyenv/versions/3.13.4/bin/python3.13
- Using VS Code
Actual behavior
- VS Code debugger gets stuck once breakpoint is hit.
- UI does not switch to source code line.
- Debugger controls (Resume, Step Out, etc.) are unresponsive.
- HTTP server hangs (no response).
- However, the VS Code CALL STACK shows status: "PAUSED".
Expected behavior
- Debugger pauses on the specified line and focuses editor on source code.
- Debugger controls should remain fully functional.
- Upon resuming, the HTTP server should respond correctly:
HTTP/1.0 200 OK
Content-Length: 13
Content-Type: text/plain
Date: Wed, 11 Jun 2025 20:54:32 GMT
Server: WSGIServer/0.2 CPython/3.13.4
Hello world!
Steps to reproduce:
- Clone the sample project: https://github.com/totobest/python-debug-test
- Setup Python interpreter and install venv (poetry configuration is included)
- Launch the included "wsgiref" debug configuration..
- Set a breakpoint on line 5 or 6 of main.py..
- In a terminal, run:
curl -i localhost:8000
Additional Context
- Issue occurs consistently across Python versions 3.9 to 3.13.
- Tested across multiple Python Debugger extension versions (2024.x to latest).
- Works as expected when no breakpoint is set.
- Removing the call to
wrap_wsgi_app(app)(line 8) resolves the issue entirely.
- 主要语言
- Python
- 星标
- 2.5k
- 派生
- 202
- 平均合并
- 5 天 1 小时
- 30 天内合并 PR
- 1
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/debugpy 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
-
documentation
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 2/5 1-3 小时 新手友好度 78/100
-
documentation
难度 2/5 1-3 小时 新手友好度 62/100
-
难度 3/5 1-2 天 新手友好度 68/100
查看 microsoft/debugpy 的全部 Issue
相似的 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 70/100
canonical/paas-charm#368 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
tech debt
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 1/5 1 小时以内 新手友好度 90/100
StevenBlack/hosts#3256 ·
-
难度 1/5 1 小时以内 新手友好度 90/100
qualcomm/qai-appbuilder#275 ·