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

Current file thinks it is not just my code #457

Closed
rchiodo opened this issue Nov 2, 2020 · 2 comments
Closed

Current file thinks it is not just my code #457

rchiodo opened this issue Nov 2, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@rchiodo
Copy link
Contributor

rchiodo commented Nov 2, 2020

Environment data

  • debugpy version: 1.1.0
  • OS and version: 10
  • Python version (& distribution if applicable, e.g. Anaconda): 3.8.5
  • Using VS Code or Visual Studio: VS Code

Actual behavior

Run debugger and stick breakpoints in a simple file
Breakpoints hit

Expected behavior

Breakpoints don't hit

Relevant log contents

Request for breakpoint in: d:\Source\Testing_4\logTestter.py line: 16
Breakpoint (after path translation) in: d:\Source\Testing_4\logTestter.py line: 16
File not traced (not in project - force_check_project_scope): d:\Source\Testing_4\logTestter.py
Added breakpoint:d:\source\testing_4\logtestter.py - line:16 - func_name:None

sending cmd (http_json) -->           CMD_RETURN {"type": "response", "request_seq": 8, "success": true, "command": "setBreakpoints", "body": {"breakpoints": [{"verified": false, "message": "Breakpoint in file excluded by filters.\nNote: may be excluded because of \"justMyCode\" option (default == true).Try setting \"justMyCode\": false in the debug configuration (e.g., launch.json).\n", "source": {"name": "logTestter.py", "path": "d:\\Source\\Testing_4\\logTestter.py"}, "line": 16}]}, "seq": 18, "pydevd_cmd_id": 502}

Uploaded logs
debugpy.server-21156.zip

@int19h int19h added the bug Something isn't working label Nov 2, 2020
@int19h
Copy link
Contributor

int19h commented Nov 2, 2020

One thing that sticks out here is that d:\ is lowercased - perhaps that's why it's not detecting it as project scope?

@fabioz
Copy link
Collaborator

fabioz commented Nov 5, 2020

The issue is that the one of the folders in the library roots matches the filename with a .startswith (when lowercase).

i.e.:

Library root matched in sys.prefix: d:\Source\Testing_4\LogTest(D:\Source\Testing_4\LogTest)

Filename: d:\Source\Testing_4\logTestter.py

So, it's a bit of a coincidence that this happened... it should be possible to fix by always appending the trailing \ or / to the directory names so that the .startswith approach doesn't break in this particular situation.

fabioz added a commit to fabioz/debugpy that referenced this issue Nov 6, 2020
@fabioz fabioz closed this as completed in 75bb3a7 Nov 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants