-
Notifications
You must be signed in to change notification settings - Fork 142
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
[Jupyter Integration w/ Docker] Debugger breaks at the wrong place #664
Comments
@DonJayamanne can you provide the logs related to that? To obtain the logs it's possible to set the following environment variables (they must be set prior to importing the debugger):
|
Oh sorry, didn't do that. Karthik said that providing the instructions was sufficient. |
Given that this repros only under a pretty specific scenario, it'd be nice to have those to know that I'm looking at the same thing (I still haven't tried to reproduce it, I'll do that tomorrow). |
Hi Don, it seems that these log files are from Usually when you set the debugging it also creates |
Is it not possible for you to start this in a docker container at this stage (to replicate this issue). |
Ok, I've just been able to reproduce it here (I had to install everything from scratch, including wsl/docker on Windows, and it reproduced properly, so, as it's more work than I thought on your side, let me try to diagnose directly here). |
Log obtained: An interesting note from the logs: although |
I'm finishing for the day here. From what I can see, the debugger integration sends the contents prefixed by
becomes:
Apparently the kernel is executing line-by-line and not as a single statement (it seems it has something as an I still haven't decided on the best approach to fix this. One approach could be considering anything in Still it's possible that there's a better approach to the problem as a whole, so, I'm going to sleep on it to think a bit more before providing a pull request... |
I created a pull request to consider everything in For instance, the client could request for Also, I noted that the source mapping is not really matching what ipython has (so, breakpoints in the i.e.: the paths that are being generated in the kernel are something as: So, in the end the fix I could think of in the debugger side is available in the pull request, but the client could be improved so that this doesn't rely as much on the library filtering... |
Yes, thats correct. we've fixed this in the latest insider build of the Jupyter extension. If you install VS Code Insiders, you'll get the fix in the latest Jupyter extension (which targets vscode insiders). |
Environment data
import debugpy; print(debugpy.__version__)
if uncertain)Actual behavior
Debugger stops at
interactiveShell.py
file at the liesys.execthook = old_excepthook
This seems to be reproducible only in containers or codespaces.
Expected behavior
Debugger should stop in the code that the user same. In my example i ran
sample.py
. Hence it should break either insample.py
or a temporary file with the same code.Please note: In desktop, the issue with source mappings will be resolved in the latest Jupyter extension, see here microsoft/vscode-jupyter#6534
Steps to reproduce:
3. Open folder in VS Code
4. When prompted to open in
Container
click yesPython 3.9
as your workspace interpreter in python (bottom left statusbar)ipykernel
into thePython 3.9
environment8 . Create a file named
sample.py
and the the following codeRun Cell | Run Below | Debug Cell
Run cell
and confirm it gets executedDebug Cell
interactiveShell.py
file at the liesys.execthook = old_excepthook
Note:
pip uninstall ipykernel debugpy ipython
python -m pip install ipython==7.15.0 ipykernel==5.5.5
However even with this (old version), the issue repros.
The text was updated successfully, but these errors were encountered: