Skip to content
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

[BUG] Hooking traceback in vscode notebook prevents exceptions from raising #2146

Open
vnghia opened this issue Apr 3, 2022 · 3 comments
Open
Labels

Comments

@vnghia
Copy link

vnghia commented Apr 3, 2022

Describe the bug

When using traceback.install() in vscode, exceptions aren't raised anymore. The cell status is success and the code continues running.

Inside a notebook in vscode

import rich
rich.traceback.install();
raise ValueError

image

Platform

Click to expand

What platform (Win/Linux/Mac) are you running on? What terminal software are you using? I tested on all 3 OSes.

╭──────────────────── <class 'rich.console.Console'> ─────────────────────╮
│ A high level console interface.                                         │
│                                                                         │
│ ╭─────────────────────────────────────────────────────────────────────╮ │
│ │ <console width=93 ColorSystem.TRUECOLOR>                            │ │
│ ╰─────────────────────────────────────────────────────────────────────╯ │
│                                                                         │
│     color_system = 'truecolor'                                          │
│         encoding = 'utf-8'                                              │
│             file = <ipykernel.iostream.OutStream object at 0x10daead00> │
│           height = 100                                                  │
│    is_alt_screen = False                                                │
│ is_dumb_terminal = False                                                │
│   is_interactive = False                                                │
│       is_jupyter = True                                                 │
│      is_terminal = False                                                │
│   legacy_windows = False                                                │
│         no_color = False                                                │
│          options = ConsoleOptions(                                      │
│                        size=ConsoleDimensions(width=93, height=100),    │
│                        legacy_windows=False,                            │
│                        min_width=1,                                     │
│                        max_width=93,                                    │
│                        is_terminal=False,                               │
│                        encoding='utf-8',                                │
│                        max_height=100,                                  │
│                        justify=None,                                    │
│                        overflow=None,                                   │
│                        no_wrap=False,                                   │
│                        highlight=None,                                  │
│                        markup=None,                                     │
│                        height=None                                      │
│                    )                                                    │
│            quiet = False                                                │
│           record = False                                                │
│         safe_box = True                                                 │
│             size = ConsoleDimensions(width=93, height=100)              │
│        soft_wrap = False                                                │
│           stderr = False                                                │
│            style = None                                                 │
│         tab_size = 8                                                    │
│            width = 93                                                   │
╰─────────────────────────────────────────────────────────────────────────╯
╭─── <class 'rich._windows.WindowsConsoleFeatures'> ────╮
│ Windows features available.                           │
│                                                       │
│ ╭───────────────────────────────────────────────────╮ │
│ │ WindowsConsoleFeatures(vt=False, truecolor=False) │ │
│ ╰───────────────────────────────────────────────────╯ │
│                                                       │
│ truecolor = False                                     │
│        vt = False                                     │
╰───────────────────────────────────────────────────────╯
╭─────── Environment Variables ────────╮
│ {                                    │
│     'TERM': 'xterm-color',           │
│     'COLORTERM': 'truecolor',        │
│     'CLICOLOR': '1',                 │
│     'NO_COLOR': None,                │
│     'TERM_PROGRAM': 'iTerm.app',     │
│     'COLUMNS': None,                 │
│     'LINES': None,                   │
│     'JPY_PARENT_PID': None,          │
│     'VSCODE_VERBOSE_LOGGING': 'true' │
│ }                                    │
╰──────────────────────────────────────╯
platform="Darwin"

In the meantime, I suggest we disable install() inside vscode by checking VSCODE_PID microsoft/vscode-jupyter#3364. I could send a PR for this if you want. Thank you very much !

@vnghia vnghia changed the title [BUG] Hooking traceback in vscode notebook prevents the exception from raising [BUG] Hooking traceback in vscode notebook prevents exceptions from raising Apr 3, 2022
@pstanisl
Copy link

pstanisl commented Aug 8, 2022

Same behavior in Databricks, issue #2455

@artemisart
Copy link

This is due to #2271

@lainisourgod
Copy link

same behaviour

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants