Debugger does not stop for uncaught Python exceptions raised from native code
See original GitHub issueFrom @zneak on August 3, 2017 0:9
Environment data
VS Code version: Version 1.14.2 (1.14.2) Python Extension version: 0.6.9 Python Version: Python 2.7.10 OS and version: macOS Sierra 10.12.4
Actual behavior
The debugger does not stop when an uncaught exception is raised from native code, even if the breakpoint on “uncaught exceptions” is set.
Expected behavior
The debugger should probably stop wherever looks the most appropriate (probably on the most recent Python stack frame).
Steps to reproduce:
- Install Cython
- Create an “ext.pyx” file that only contains
raise KeyError("oopsie")
- Build extension with Cython, then copy the shared object to a place that you can easily import it from (like the source folder)
- From VS Code, create and run a Python script that imports said extension
Logs
Output from Python
output panel: (traceback …)
Output from Console window
(Help->Developer Tools menu): (empty)
Copied from original issue: DonJayamanne/pythonVSCode#1137
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
Debugger does not stop for uncaught Python exceptions ...
The debugger does not stop when an uncaught exception is raised from native code, even if the breakpoint on "uncaught exceptions" is set....
Read more >PyCharm Debugging - Stop on Unhandled Exceptions
To ensure this is set up correctly, go to Run > View Breakpoints (Ctrl + Shift + F8). In the dialog box, ensure...
Read more >While debugging, how can I break on raised exceptions ...
A try-except block prevents the code from crashing when it's not being debugged or if the debugger isn't installed. # To enable or...
Read more >Manage exceptions with the debugger in Visual Studio
Learn how to specify which exceptions the debugger breaks on, at which point you want the debugger to break, and how breaks are...
Read more >Setting Breakpoints and Exception Hooks in Python
One way to address this problem and gain better control over where to break your code is to insert a breakpoint directly into...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@zneak I’ve got some great news for you. We’ve been actively working on a new debugger for the python extension and believe this feature works in that
experimental debugger
.Please ensure you have the latest version of the python extension and
Experimental
debugger."type":"python"
inlaunch.json
to"type":"pythonExperimental"
Do let us know how this goes.
Please ensure the
pyx
files are located in the same directory as the compiled output (this way the debugger will file the file and break at the corresponding line of code in thepyx
file).This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don’t have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.