Skip to content

User Uncaught Exceptions setting should be false by default #751

@RobertCsordas

Description

@RobertCsordas

Environment data

  • VS Code version: 1.61.0
  • Extension version (available under the Extensions sidebar): v2021.10.1317843341
  • OS and version: Ubuntu 20.04.2 LTS
  • Python version (& distribution if applicable, e.g. Anaconda): 3.8.10
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
  • Relevant/affected Python packages and their versions: pytorch (troch==1.9.0)
  • Relevant/affected Python-related VS Code extensions and their versions: XXX
  • Value of the python.languageServer setting: Pylance

Expected behaviour

The following code should not raise an exception.

import torch.utils.data


class Cls():
    def __getattr__(self, item):
        raise AttributeError()


o = Cls()
print(isinstance(o, torch.utils.data.IterableDataset))

Actual behaviour

The code stops on the "raise AttributeError()" line and shows an exception is raised. If one clicks "Continue", the code continues correctly. But it is still pretty annoying to click it every single time it happens in a big project.

If one runs it from the terminal without VSCode debugger, it runs without issues.

Steps to reproduce:

Run the code above from vscode. The launch.json entry for it:

{
    "type": "python",
    "request": "launch",
    "name": "Debug File",
    "justMyCode": false,
    "program": "${file}",
    "cwd": "${fileDirname}"
}

Other

It might be related to microsoft/vscode-python#17687, but not sure.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions