Please disable pretty_exception_enable by default #654
-
First Check
Commit to Help
Example Codeimport typer
voglio_morire = typer.Typer(name="voglio_morire", pretty_exceptions_enable=False) DescriptionException pretty printing is harmful and completely useless in basically every situation I can think of. Plus, it's not safe to turn it off by simply passing:
Because this will add an implicit dependency to your code: in order to do this you need to have typer>=0.7, otherwise, an error will be raised. The easiest solution is to manually check the typer version, and then disabling the option if it is >= 0.7 Pretty print exception only works in toy examples when the stack has a depth of 1 to 3, unless you like to have your terminal completely cluttered with magical rainbow stuff, which more often than not exceeds the tty length, you should not use this in a real-world scenario. Please disable it by default. Operating SystemLinux, Windows, macOS, Other Operating System DetailsNo response Typer Version
Python VersionAny Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I am finding myself turning it off as well, as the tracebacks have such depth as to be overwhelming. I'm not sure if there's a bug that's resulting in really high depth tracebacks or if that's to be accepted (even in "short" mode), but I'm going to disable entirely. |
Beta Was this translation helpful? Give feedback.
-
I also wanted to disable In the documentation, it says this feature is only active if you install the optional dependency rich, however if I do Example pretty exception |
Beta Was this translation helpful? Give feedback.
You can install the minimal version which does not come with Rich
pip install typer-slim