You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
VSCode python debugger does not go inside the third party library code even with justmycode set to false on 1.90 VS code #1596
debug point at data = yaml.safe_load(f)
I can ctrl+click and go inside yaml.safe_load() and set a breakpoint in that method but when debugging, the control remain in the my code and does not go inside the safe_load(). Instead I can see that there is a light green debug arrow and a light green horizonal bar in that code. Pressing next jumps to the next statement inside that code but the control goes back to my code and I have to come back to safe_load() to see where the green arrow has moved to.
Please refer the below pics:
Expected behavior
The control, Yellow debug point and the horizontal bar should go inside the safe_load()
Thanks for the issue. I can repro. It looks like VS code isn't allowing stepping into the just my code frames, even though the debugger is returning a stop event inside those frames:
changed the title [-]VSCode python debugger does not go inside the third party library code even with justmycode set to false[/-][+]VSCode python debugger does not go inside the third party library code even with justmycode set to false on 1.90 VS code[/+]on Jun 7, 2024
I got same issue when upgrade vscode to 1.90, the debugger have green line in library when debug, but it always switch to outside of library, maybe an issue of vscode
Alexander Zagajewski (@azagajewski) I recommend entering a new issue. JustMyCode works for me. It all depends upon how you get debugpy into the process.
Rich Chiodo (@rchiodo) Could you share how you set it up? I've just my code in user setting disabled and with following launch.json, it didn't work from python test explorer (the extension which allows you run/debug from UI by clicking a button next to any single test).
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Debug Tests",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"purpose": [
"debug-test"
],
"console": "integratedTerminal",
"justMyCode": false
},
]
}
Switching back to python from debugpy worked straight away.
Rich Chiodo (@rchiodo) Thanks for a very fast response; I've just set up the dummy test above and gave it a go, I wasn't able to step into approx with debugpy however with python it worked. Bizarre. What else can I provide to help us here?
Not sure what you mean by 'python'. As the 'type' in the launch.json?
Maybe that's using a different way to launch. I get this when I put that there:
You should make sure your extensions are the latest if that warning isn't coming through.
Rich Chiodo (@rchiodo) Yes the python to replace debugpy in type=debugpy. I did also get the warning but it was a deprecation only, I believe we can still fall back to the option python, i.e., type=python.
The terminal output looks similar, the key part is that I am calling debugpy,
But I didn't seem to get the pytest relevant output.
If I ran it just by clicking the button next to the test, a typical way Python Test Explorer; I wasn't able to access the library code with keyboard shortcut either.
Clicking the green triangle button on the debugging pane (alt+5 for me on the keyboard would open it on the left side) does seem to let me get into the library code. Other than this, to no avail.
Actually, never mind, I found this on python test explorer repo:
Configuring debug
The extension will look for a configuration in launch.json with "type": "python" and "purpose": ["debug-test"] (or "request": "test") to load any of the following options during debugging
name
console
env
stopOnEntry
showReturnValue
redirectOutput
debugStdLib
justMyCode
subProcess
envFile
This issue has been bugging me for a while as well. I have solved it simply by unchecking "Raised Exceptions" in the Breakpoints tab of VSCode.
This way it only breaks for uncaught exceptions.
Activity
couteau commentedon Jun 7, 2024
I've had the same issue since VS Code updated to v 1.90, using the debugger extension v2024.6.0.
uvnikgupta commentedon Jun 7, 2024
Were you able to find a solution to resolve this issue?
uvnikgupta commentedon Jun 7, 2024
Found a workaround.
For those who are still scratching their head, downgrade your VS code to v1.89 from here
rchiodo commentedon Jun 7, 2024
Thanks for the issue. I can repro. It looks like VS code isn't allowing stepping into the just my code frames, even though the debugger is returning a stop event inside those frames:
rchiodo commentedon Jun 7, 2024
And I can also verify switching back to 1.89 fixes the problem for me too. This is likely a VS code issue then.
rchiodo commentedon Jun 7, 2024
Closing in favor of the VS code issue.
[-]VSCode python debugger does not go inside the third party library code even with justmycode set to false[/-][+]VSCode python debugger does not go inside the third party library code even with justmycode set to false on 1.90 VS code[/+]nguyenvanhuybk99 commentedon Jun 13, 2024
I got same issue when upgrade vscode to 1.90, the debugger have green line in library when debug, but it always switch to outside of library, maybe an issue of vscode
rchiodo commentedon Jun 13, 2024
This is the VS code issue causing the problem:
microsoft/vscode#214433
It's marked as a candidate so it should ship soon.
joanPlepi commentedon Aug 12, 2024
I downgraded visual studio to version 1.89.1 and it is still failing to stop in a breakpoint inside a package:
My configuration
launch.jsonis as follows:{ "version": "0.2.0", "configurations": [ { "name": "Python Debugger: Current File", "type": "debugpy", "request": "launch", "program": "${file}", "stopOnEntry": true, "justMyCode": false }, { "name": "Python Debugger: Python File", "type": "debugpy", "request": "launch", "program": "${file}", "stopOnEntry": true, "justMyCode": false } ] }azagajewski commentedon Feb 17, 2025
Is this fixed yet? On 1.97 currently (on a remote dev server via ssh) and this still appears to be an issue
rchiodo commentedon Feb 18, 2025
Alexander Zagajewski (@azagajewski) I recommend entering a new issue. JustMyCode works for me. It all depends upon how you get debugpy into the process.
qiuxiaomu commentedon May 5, 2025
Rich Chiodo (@rchiodo) Could you share how you set it up? I've just my code in user setting disabled and with following launch.json, it didn't work from python test explorer (the extension which allows you run/debug from UI by clicking a button next to any single test).
Switching back to
pythonfromdebugpyworked straight away.rchiodo commentedon May 5, 2025
This is what I was using:
{ "name": "Python: Debug Tests", "type": "debugpy", "request": "launch", "program": "${file}", "purpose": [ "debug-test" ], "console": "integratedTerminal", "justMyCode": false, },My test looked like this:
And I was able to step into the 'pytest.approx' function
qiuxiaomu commentedon May 5, 2025
Rich Chiodo (@rchiodo) Thanks for a very fast response; I've just set up the dummy test above and gave it a go, I wasn't able to step into
approxwith debugpy however with python it worked. Bizarre. What else can I provide to help us here?rchiodo commentedon May 5, 2025
Not sure what you mean by 'python'. As the 'type' in the launch.json?
Maybe that's using a different way to launch. I get this when I put that there:
You should make sure your extensions are the latest if that warning isn't coming through.
rchiodo commentedon May 5, 2025
Otherwise it should be starting debugpy like so when you debug the test:
My terminal output looks like so.
qiuxiaomu commentedon May 6, 2025
Rich Chiodo (@rchiodo) Yes the
pythonto replacedebugpyintype=debugpy. I did also get the warning but it was a deprecation only, I believe we can still fall back to the optionpython, i.e.,type=python.The terminal output looks similar, the key part is that I am calling
debugpy,But I didn't seem to get the pytest relevant output.
If I ran it just by clicking the button next to the test, a typical way Python Test Explorer; I wasn't able to access the library code with keyboard shortcut either.
Clicking the green triangle button on the debugging pane (alt+5 for me on the keyboard would open it on the left side) does seem to let me get into the library code. Other than this, to no avail.
qiuxiaomu commentedon May 6, 2025
Actually, never mind, I found this on python test explorer repo:
They seem to fall behind the schedule there.
clement-moulin-frier commentedon Jul 5, 2025
This issue has been bugging me for a while as well. I have solved it simply by unchecking "Raised Exceptions" in the Breakpoints tab of VSCode.
This way it only breaks for uncaught exceptions.