1
Vote

Exceptions > Reset All is not enabling some exception types

description

When I open the Debug > Exceptions... window and hit Reset All, the following exceptions are not checked in the "user-unhandled" column (for either Python 2 or 3):
  • bulitins.AttributeError
  • builtins.GeneratorExit
  • builitins.IndexError
  • builtins.KeyError
  • builtins.StopIteration
If I check them manually the debugger breaks on them as expected. If I hit Reset All they are unchecked again.

This behaviour is sensible for StopIteration and GeneratorExit but not the others!

comments

Zooba wrote Aug 3 at 9:27 PM

It's a little annoying I agree, but it's more annoying to have your program constantly being interrupted by these exceptions when we've failed to detect a handler for them (note that we have to do the detection by source analysis, since Python has no indication at the time the exception is raised and only performs single-pass unwinding). IndexError and AttributeError are often silently handled by for loops or getattr/hasattr calls (and sometimes normal attribute lookup), which is why we don't want to break on those by default - we can't reliably tell whether they will be handled or not.

It's too late for PTVS 2.1 now, but if you have any ideas on reliable ways to detect these we'd love to hear them. Right now our biggest issue is breaking too often (false positives) mostly due to a lack of source code (eggs or pycs, for example), so we're hesitant to increase the number of false positives.

Artfunkel wrote Aug 5 at 11:04 AM

I've never actually had the problem you're talking about, so I might be wrong, but borrowing the "Just My Code" paradigm from .Net sounds like it might work. If one of those exceptions are thrown, only break when control is about to enter a file included in the user's project.