Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#1,964 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python, vscode

Research direction

Reproduce the failure with C:\repro\archive.zip_\files\app\script.py and the .vscode/launch.json configuration, using debugpy.connect() and debugpy.breakpoint(). Start by tracing the source lookup and path-mapping handling for the .zip_ segment on Windows. Done means the literal path opens in VS Code, breakpoints bind, and stepping no longer falls back to a top-level exec frame.

Written by the indexing model from the issue text.

Description

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
Dominant language
Python
Stars
2.5k
Forks
202
Avg merge
5d 1h
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/debugpy

All issues in microsoft/debugpy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.