[BUG] rich.traceback.install(width: int) is ignored when stderr is not a tty
See original GitHub issueRich traceback output is forced to a width of 80 columns when there is no tty on neither stdout nor stderr:
./im_going_to_crash.py 2>&1 | cat
This is in spite of me setting the width
in rich.traceback.install
to something else. It is completely ignored and seem to simply use the value 80
.
Possible inconsistency:
The function default value seem to be set to 100
, different from rich.console.Console
which seem to default width
to None
.
Rich version: 10.16.2
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top Results From Across the Web
[BUG] rich.traceback.install(width: int) is ignored when stderr is not a tty
When there is no tty, Rich is unable to detect the width of the terminal, and so defaults to a maximum of 80...
Read more >rich/console.py at master · Textualize/rich - GitHub
Rich is a Python library for rich text and beautiful formatting in the terminal. ... def update_width(self, width: int) -> "ConsoleOptions":.
Read more >Source code for rich.console - Rich's documentation!
Args: width (int): New width (sets both min_width and max_width) Returns: ... stderr (bool, optional): Use stderr rather than stdout if ``file`` is...
Read more >Release Notes — Airflow Documentation
In order to make airflow dags test more useful as a testing and debugging tool, we no longer run a backfill job and...
Read more >Changelog — Python 3.11.1 documentation
gh-97527: Fix a bug in the previous bugfix that caused IDLE to not start when run with 3.10.8, 3.12.0a1, and at least Microsoft...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
When there is no tty, Rich is unable to detect the width of the terminal, and so defaults to a maximum of 80 characters.
If you know the width, you can set the
COLUMNS
environment variable.Also, when running my script, I can use
COLUMNS
to reduce the width, but it seems to cap out at 100 regardless of what I set forwidth
(I assume since that is the default).