use stderr=true instead of file=sys.stderr for traceback handler install

This commit is contained in:
Ronny Pfannschmidt 2023-03-01 18:06:27 +01:00
parent cba485f6c4
commit d61491d0f3
3 changed files with 3 additions and 1 deletions

View File

@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Fixed pretty printing of empty dataclass https://github.com/Textualize/rich/issues/2819
- Use `Console(stderr=True)` in `rich.traceback.install` to support io redirection.
## [13.3.1] - 2023-01-28

View File

@ -37,6 +37,7 @@ The following people have contributed to the development of Rich:
- [Dave Pearson](https://github.com/davep/)
- [Avi Perl](https://github.com/avi-perl)
- [Laurent Peuch](https://github.com/psycojoker)
- [Ronny Pfannschmidt](https://github.com/RonnyPfannschmidt/)
- [Olivier Philippon](https://github.com/DrBenton)
- [Kylian Point](https://github.com/p0lux)
- [Kyle Pollina](https://github.com/kylepollina)

View File

@ -86,7 +86,7 @@ def install(
Callable: The previous exception handler that was replaced.
"""
traceback_console = Console(file=sys.stderr) if console is None else console
traceback_console = Console(stderr=True) if console is None else console
locals_hide_sunder = (
True