question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Debugger does not stop for uncaught Python exceptions raised from native code

See original GitHub issue

From @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:closed
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
DonJayamannecommented, May 4, 2018

@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

  • Test this using the Experimental debugger.
  • Or just change the setting "type":"python" in launch.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 the pyx file).

0reactions
no-response[bot]commented, Jun 11, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found