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

Hitting a breakpoint opens a new instance of the file #1736

Closed
alexandre-perrin opened this issue Nov 18, 2024 · 2 comments
Closed

Hitting a breakpoint opens a new instance of the file #1736

alexandre-perrin opened this issue Nov 18, 2024 · 2 comments
Assignees
Labels
needs repro Issue has not been reproduced yet

Comments

@alexandre-perrin
Copy link

alexandre-perrin commented Nov 18, 2024

I am hitting an issue occurring at the moment on only one file in my project.
When I launch a debug session with a break point on this specific file, the debugger opens a new tab each time the debugger breaks.

Environment data

VS Code version: 1.95.3
Extension version (available under the Extensions sidebar): v2024.12.0
OS and version: Kubuntu 22.04
Python version (& distribution if applicable, e.g. Anaconda): Python 3.10.12
Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv or none, same issue

Test with pytest and pyfakefs

Expected behaviour

When hitting a breakpoint during debug, the corresponding line in the already opened source file should be highlighted

Actual behaviour

A new tab is opened with the file with breakpoint, then opens a new tab for each debug step.

@alexandre-perrin
Copy link
Author

One more thing I just noticed, this occurs only with usage of pyfakefs pytest plugin...

It could be related that the file system gets mocked and alters the behaviour of the debugger.

@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python-debugger Nov 18, 2024
@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Nov 18, 2024
@rchiodo
Copy link
Contributor

rchiodo commented Nov 18, 2024

Yes pyfakefs would cause the debugger to think the actual file doesn't exist because pyfakefs is rewiring the file system.

See these issues for more information:
#1709
#267

@rchiodo rchiodo closed this as completed Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Issue has not been reproduced yet
Projects
None yet
Development

No branches or pull requests

3 participants