From 2fd837f254938d5f180f2faecee90b846c41f259 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Wed, 25 Sep 2024 00:40:37 -0700 Subject: [PATCH] setup rich tracebacks width properly in monkey patched exception handler --- archivebox/monkey_patches.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/archivebox/monkey_patches.py b/archivebox/monkey_patches.py index c68be8fd..2fb77d5b 100644 --- a/archivebox/monkey_patches.py +++ b/archivebox/monkey_patches.py @@ -1,5 +1,9 @@ __package__ = 'archivebox' +import django +import pydantic +import shutil + import django_stubs_ext django_stubs_ext.monkeypatch() @@ -19,7 +23,7 @@ timezone.utc = datetime.timezone.utc # https://rich.readthedocs.io/en/stable/traceback.html#traceback-handler from rich.traceback import install -install(show_locals=True) +install(show_locals=True, word_wrap=False, locals_max_length=10, locals_hide_dunder=True, suppress=[django, pydantic], extra_lines=2, width=shutil.get_terminal_size((100, 10)).columns - 1) from daphne import access