Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

VS Code Debugger Freezes When Using wrap_wsgi_app with debugpy

未关闭
#1,908 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
38/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
python, vscode
领域
devtools

调研方向

从示例项目的 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:

  1. Clone the sample project: https://github.com/totobest/python-debug-test
  2. Setup Python interpreter and install venv (poetry configuration is included)
  3. Launch the included "wsgiref" debug configuration..
  4. Set a breakpoint on line 5 or 6 of main.py..
  5. 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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/debugpy 的其他 Issue

查看 microsoft/debugpy 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。