Closed DeshmukhMalhar closed 4 years ago
@DeshmukhMalhar do you have some kind of symlink or a subst drive there? Are you using a pytest
run?
The breakpoint misbehavior is fundamentally an issue with VSCode itself treating the two tabs as two different files, even though they're really the same. Changes in the editor propagate from one tab to the other, because they flow through the file itself. But breakpoints are metadata, and don't get the same accidental sync. But, in any case, the real problem is that the extra tab shows up in the first place, so let's try to figure that one out first!
Since you can repro it in one workspace but not another, it's likely to do with configuration. Can you please share the debug configuration from launch.json that you're using when the bug happens, and also the one for the project where things work fine?
Also, if you're using an "attach" configuration, then the command line used to start ptvsd would also come in handy.
p.s.: I'm asking about pytest
specifically because it has an issue where it changes the working directory by resolving symlinks and substed drives, so, this could explain the issue... (see: https://github.com/pytest-dev/pytest/issues/5965)
@DeshmukhMalhar do you have some kind of symlink or a subst drive there? Are you using a
pytest
run?
no symlink or subst. I am not using pytest run
Here is a snippet of my launch.json
The breakpoint misbehavior is fundamentally an issue with VSCode itself treating the two tabs as two different files, even though they're really the same. Changes in the editor propagate from one tab to the other, because they flow through the file itself. But breakpoints are metadata, and don't get the same accidental sync. But, in any case, the real problem is that the extra tab shows up in the first place, so let's try to figure that one out first!
Since you can repro it in one workspace but not another, it's likely to do with configuration. Can you please share the debug configuration from launch.json that you're using when the bug happens, and also the one for the project where things work fine?
Also, if you're using an "attach" configuration, then the command line used to start ptvsd would also come in handy.
the real problem is extra tab appearing.
Here is the command launching ptvsd
After 12 days from my reply, I don't see any updates. Am I supposed to do anything more?
@DeshmukhMalhar sorry for the delayed reply. I think at this point we will need a way to repro this locally. If possible please share a minimal repro.
I tested this with another python file in the same project, and I the tab duplication does not happen for it. I don't know why.
there are two args if it helps
The debugger should start stepping through the same file on which it was launched on, not create a new file/tab.
Are there any differences between the file for which you are seeing double tabs, and the one for which it doesn't happen? E.g. anything unusual about the filename, or a different path?
Perhaps there's any difference in which those files are getting executed by your main script? E.g. one is imported, and the other one is execfile()
'd, or something similar?
@DeshmukhMalhar can you provide the logs for a session run where you have breakpoints in both versions of the file and it opens both after breakpoints hit?
Some notes on how to do that:
Please make sure that you're using the latest version of the debugger (see: https://github.com/microsoft/ptvsd/issues/2104 to check how to do that).
Make a debug run and provide the logs.
i.e.:
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File (Integrated Terminal)",
"type": "python",
"request": "launch",
"program": "${file}",
"stopOnEntry": true,
"console": "integratedTerminal",
"logToFile": true
},
We can't reproduce, so without the logs this isn't actionable. Please re-open if you're still having this problem and can share the logs.
This issue is same as microsoft/vscode-python#5139, microsoft/vscode-python#225 and microsoft/vscode-python#4166 which closed and those suggest updating python ext, but mine is already up to date[2020.2.63072].
Issues microsoft/vscode-python#5049 and microsoft/vscode-python#1313 are similar in nature.
and no, This is not the case of lowercase drive letters as said in https://github.com/microsoft/vscode-python/issues/2976#issuecomment-431946411
The problem here is that the breakpoints if marked in the original file, are carried over but can't be disabled from the new file. As well as breakpoints created in the new file are not migrated back to original file. i.e. the breakpoints are treated different.
This leads to confusion in debugging as you just cannot see why the debugger is halting If I want to remove a breakpoint, I have to use the breakpoints explorer.
This is the look of breakpoints explorer in debugger
And by habbit , assuming that the file being debugged is displayed, I start editing the file and save it, which propagates the contents to the original file, but the breakpoints in the original file are now ordered very differently, thus making the debugger stop everywhere. Which is just annoying.
The steps to reproduce the issue are mentioned here : https://github.com/microsoft/vscode-python/issues/225#issue-273959633
and examples are here : https://github.com/microsoft/vscode-python/issues/4166#issue-403825856
However, When I created a new Project, I was unable to produce the same result. Then I thought that It may be because I have multiple Launch configurations in my project, but testing with two launch configs in the new project does not seem to reproduce the issue.
I will try to provide as much info I can on this
The python interpreter is a conda env and code was started from conda powershell prompt in both cases
System Info:
AMD R7 1700 @3GHZ RAM 16GB, 52% usage Multiple HDDs and SSDs VSCode version 1.42.1
Python Extension version : 2020.2.63072
conda_problem_env_packges_installed.txt
EDIT: UNRELETED: Why is Github linking /pull/1313 at microsoft/vscode-python#1313 ?
Where it links /issues/# everywhere else?