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
Debugging literally a print("hi") file with "justMyCode": false in launch.json
Expected vs. Actual Behaviour
A wild exception appears:
[Errno 2] No such file or directory: '/usr/lib/python310.zip'
File "/usr/lib/python3.10/genericpath.py", line 19, in exists
os.stat(path)
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
Steps to reproduce:
launch.json:
{
// 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": "hi.py",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/hi.py",
"console": "integratedTerminal",
"justMyCode": false
}
]
}
This is not a 3.10 specific quirk; I tried installing a python36 package and got a stack with the same meaning:
[Errno 2] No such file or directory: '/home/user/.local/lib/python3.6'
File "/usr/lib/python3.6/posixpath.py", line 171, in islink
st = os.lstat(path)
File "/usr/lib/python3.6/posixpath.py", line 429, in _joinrealpath
if not islink(newpath):
File "/usr/lib/python3.6/posixpath.py", line 395, in realpath
path, ok = _joinrealpath(filename[:0], filename, {})
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
If I create ~/.local/lib/python3.6/site-packages directory, the stack is exactly the same as for 3.10.
I am pretty sure that about a month or two ago I did not need or even know about justMyCode setting and was debugging just fine.
Diagnostic data
Python version (& distribution if applicable, e.g. Anaconda): 3.10.1
Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Global
Value of the python.languageServer setting: Pylance
Extension version: 2021.12.1559732655
VS Code version: Code 1.63.2 (899d46d82c4c95423fb7e10e68eba52050e30ba3, 2021-12-15T09:39:46.686Z)
OS version: Linux x64 5.10.89-1-MANJARO
Restricted Mode: No
System Info
Item
Value
CPUs
Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz (8 x 4061)
This isn't really a bug, you're seeing that because you have Raised Exceptions checked and you selected to show any exception even in the standard library (due to the justMyCode:false).
You can just ignore the raised exception and resume the debugger execution (or you can uncheck the Raised Exceptions if you don't want to see those).
Thanks, that kinda helped, but is there a way to filter "not my code" scope somehow in this regard?
In this case, I am trying to debug the (raised but caught at some point) exception inside third-party library, so I could use something like
Regarding exceptions, unfortunately no (improvements here have already been brought up in #790 but there's no timeline to tackle those).
An alternative may be defining what's considered your own code (when justMyCode: true) with an environment variable:
i.e.: You can define an environment variable: IDE_PROJECT_ROOTS which is a string separated with os.pathsep -- ":" on Linux and ";" on Windows with the folders that you want to consider your own code, although note that this will be regarded for everything then (not just exceptions).
Issue Type: Bug
Behaviour
Debugging literally a
print("hi")
file with"justMyCode": false
inlaunch.json
Expected vs. Actual Behaviour
A wild exception appears:
Steps to reproduce:
launch.json
:This is not a 3.10 specific quirk; I tried installing a
python36
package and got a stack with the same meaning:If I create
~/.local/lib/python3.6/site-packages
directory, the stack is exactly the same as for 3.10.I am pretty sure that about a month or two ago I did not need or even know about
justMyCode
setting and was debugging just fine.Diagnostic data
python.languageServer
setting: PylanceUser Settings
Extension version: 2021.12.1559732655
VS Code version: Code 1.63.2 (899d46d82c4c95423fb7e10e68eba52050e30ba3, 2021-12-15T09:39:46.686Z)
OS version: Linux x64 5.10.89-1-MANJARO
Restricted Mode: No
System Info
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
rasterization: disabled_software
skia_renderer: enabled_on
video_decode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: