-
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
VSCode's "Run and Debug" or the Debugger itself seems to break Python code related to Protocols and isinstance checks #757
Comments
Same error here. If I run without debuging works fine, but I need to debug! |
The exception itself has always been there - you're seeing it now because now it gets displayed where it previously wasn't, but it's not actually fatal (i.e. you can press F5 and it'll continue running normally). To prevent debugger from breaking on this exception, uncheck "User-uncaught exceptions" in the Breakpoints list in the Debug pane. We'll change the default for this checkbox in the next release of debugpy. |
The same problem, maybe it's related to the latest update, I just turn off my machine last night and this morning it doesn't work
Note that:
|
This is a duplicate of #751 Please uncheck User Uncaught Exceptions to avoid this. |
Environment data
python.languageServer
setting: defaultExpected behaviour
To not error
Actual behaviour
Error raised when using "Debug and Run". No errors when running normally.
Steps to reproduce:
This is an issue I can only reproduce by running the code below using "Run and Debug" from vscode, and it relates to the
Protocol
feature introduced in Python 3.8, and using the debugger in vscode. I am not sure this is the right place to raise the issue, but could not think of a better place. I could not reproduce it with debugpy alone, so posting it here, rather than in the debugpy issues.Consider the following simplified example:
Running this with "Run and Debug" gives this error
However, running the file normally exits normally and gives the output:
The
isinstance
call silently handles the error that occurs when accessing the attributesome_attr
on an object on which it does not exist, which is also seen from the output where the second print statement is not reached in both invocations of__getatttribute__
. Exactly what happens when the "Debug and Run" approach to execution is used is unclear to me, but it seems to break otherwise working code.The text was updated successfully, but these errors were encountered: