Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breakpoints not found when in a folder that contains ".zipx" #265

Open
russau opened this issue Nov 28, 2023 · 0 comments
Open

Breakpoints not found when in a folder that contains ".zipx" #265

russau opened this issue Nov 28, 2023 · 0 comments

Comments

@russau
Copy link

russau commented Nov 28, 2023

I can reproduce this in VSCode with ms-python.python extension installed

If I create a file .zipx/main.py I see errors in the debugger log

    "body": {
        "breakpoints": [
            {
                "verified": false,
                "id": 1,
                "message": "Breakpoint in file that does not exist.",
                "source": {
                    "name": "main.py",
                    "path": "/Users/russau/verytemp/python-test/.zipx/main.py"
                },
                "line": 1
            }
        ]
    }

I've traced it to this line of code detecting the ".zip" in the folder name

ind = r.find('.zip')
if ind == -1:
ind = r.find('.egg')
if ind != -1:
ind += 4
zip_path = r[:ind]
inner_path = r[ind:]
if inner_path.startswith('!'):
# Note (fabioz): although I can replicate this by creating a file ending as
# .zip! or .egg!, I don't really know what's the real-world case for this
# (still kept as it was added by @jetbrains, but it should probably be reviewed
# later on).
# Note 2: it goes hand-in-hand with 'exists'.
inner_path = inner_path[1:]
zip_path = zip_path + '!'

_apply_func_and_normalize_case turns the path /Users/russau/verytemp/python-test/.zipx/main.py into /Users/russau/verytemp/python-test/.zip/x/main.py. I'm not familiar with the code, I guess it supports a "code in a zip file" feature. Maybe the fix is to test if the filename exists before entering into the "inside a zip file" logic?

Thanks all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant