-
-
Notifications
You must be signed in to change notification settings - Fork 776
✨ Add support for standard tracebacks via the env TYPER_STANDARD_TRACEBACK
#1299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
✨ Add support for standard tracebacks via the env TYPER_STANDARD_TRACEBACK
#1299
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
TYPER_STANDARD_TRACEBACK
TYPER_STANDARD_TRACEBACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, this PR adds the option to set an env var TYPER_STANDARD_TRACEBACK
while still supporting the old var _TYPER_STANDARD_TRACEBACK
too. We need to support both because we don't want to break existing workflows, but that does complicate the code slightly. I think that's an acceptable trade-off to ensure this variable can be properly set in AWS Lambda etc.
I will leave this PR for a final review by Tiangolo 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, thank you! 🚀
It seems that I can't push to your branch |
Keeps support fo `_TYPER_STANDARD_TRACEBACK` but notes as deprecated because: - It is non-standard for an advertised env to start with an underscore. - Environment variables that start with an underscore have been observed as causing issues in some execution environments (e.g. with AWS Lambda). See: fastapi#1284
b77ece1
to
0a41362
Compare
📝 Docs preview for commit 0a41362 at: https://257ad67c.typertiangolo.pages.dev Modified Pages |
This PR allows standard tracebacks to be enabled using the environment variable:
TYPER_STANDARD_TRACEBACK
.The work is a follow up to the discussion with @svlandeg: #1284.
The existing environment variable
_TYPER_STANDARD_TRACEBACK
is retained but referred to as "deprecated" because:Manual testing with:
Produces expected results: