rich icon indicating copy to clipboard operation
rich copied to clipboard

[BUG] Rich traceback not working proprely within notebook

Open samsja opened this issue 3 years ago • 0 comments

Describe the bug

When the rich traceback is enabled in a notebook, the traceback is almost unreadable and show a criptic message:

tmp/ipykernel_1565558/3782956317.py:1 in <cell line: 1>                                  │                                                                                          
 [Errno 2] No such file or directory: '/tmp/ipykernel_1565558/3782956317.py'               │

Here is a screenshot that showcase the issue with a very simple traceback. Screenshot from 2022-05-11 13-56-59

One could say that there is no point of activating the trackback from inside a notebook. However the problem persist when importing a library that enable rich traceback. (Ex in my case docarray or jina)

Screenshot from 2022-05-11 13-31-58

thanks in advance for any support :smiley: !!

Platform

Click to expand

Linux, running from jupyter notebook

from rich.diagnose import report
report()
╭────────────────────── <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 0x7f26f700bcd0> │
│           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': None,             │
│     'CLICOLOR': '1',               │
│     'NO_COLOR': None,              │
│     'TERM_PROGRAM': None,          │
│     'COLUMNS': None,               │
│     'LINES': None,                 │
│     'JPY_PARENT_PID': '1483554',   │
│     'VSCODE_VERBOSE_LOGGING': None │
│ }                                  │
╰────────────────────────────────────╯

platform="Linux"

samsja avatar May 11 '22 12:05 samsja