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

Source lookup fails for paths with “.zip_\” segment

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

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
74/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python, vscode

调研方向

使用 C:\repro\archive.zip_\files\app\script.py 和 .vscode/launch.json 配置,通过 debugpy.connect() 和 debugpy.breakpoint() 重现该失败。首先跟踪 Windows 上针对 .zip_ 段的源查找和路径映射处理。完成的标准是:字面路径能在 VS Code 中打开,断点能够绑定,单步执行不再回退到顶层 exec frame。

由索引模型根据 Issue 内容生成。

描述

bug

Before creating a new issue, please check the FAQ to see if your question is answered there.

Environment data

  • debugpy version: 1.8.15
  • OS and version: XXX: Microsoft Windows 11 Enterprise , 10.0.22631 N/A Build 22631
  • Python version : Python 3.8.9
  • Using VS Code or Visual Studio: VS Code

Actual behavior

When attaching from VS Code (debugger in listen mode) to a target process that calls debugpy.connect(...), if the script’s path contains a directory segment like ...\archive.zip_\files... (this is a normal folder, not an archive), VS Code shows:
Unable to retrieve source for C:\repro\archive.zip_\files\app\script.py
Note the path is displayed as zip_\files, whereas the actual on-disk path is zip_\files. Because of this mismatch, the source cannot be opened, breakpoints remain unresolved, and stepping falls back to a top-level exec frame.

Renaming the folder so it does not contain .zip_ makes the problem disappear.

Expected behavior

The debugger should treat the file system path literally and open the source without rewriting segments around .zip. Breakpoints should bind and stepping should work normally for any valid Windows path.

Steps to reproduce:

  1. Create the following directory structure:
    C:\repro\archive.zip_\files\app\

  2. Create C:\repro\archive.zip_\files\app\script.py with:
    import debugpy
    debugpy.connect(("127.0.0.1", 9092))
    debugpy.breakpoint()
    print(file)

In VS Code, open C:\repro\archive.zip_\files\app\ as the workspace and add .vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen 9092",
"type": "python",
"request": "attach",
"listen": { "host": "127.0.0.1", "port": 9092 },
"pathMappings": [
{
"remoteRoot": "C:\repro\archive.zip_\files\app",
"localRoot": "C:\repro\archive.zip_\files\app"
}
],
"justMyCode": true
}
]
}

  1. Start the Listen 9092 configuration in VS Code.
  2. In a separate console, run: python C:\repro\archive.zip_\files\app\script.py
  3. BOOM
主要语言
Python
星标
2.5k
派生
205
平均合并
1 天 9 小时
30 天内合并 PR
3

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

microsoft/debugpy 的其他 Issue

查看 microsoft/debugpy 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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