-
Notifications
You must be signed in to change notification settings - Fork 403
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
Static typing: Logger.exception() exc_info type does not match Python's built-in one #3356
Comments
Thanks for opening your first issue here! We'll come back to you as soon as we can. |
Workaround: Use |
hey @rafrafek thanks for spotting yet another one - we must have missed during the review (it was workaround override for the lack of stackframe in 3.8 only in logging.Logger). Tackling that shortly |
I see why this was copied as-is from CPython logging impl: https://github.com/python/cpython/blob/d67f947c72af8a215db2fd285e5de9b1e671fde1/Lib/logging/__init__.py#L1537 |
Waiting for CI to confirm it won't break previous versions, as I'm unsure when CPython added that typing alias since the |
Closing, coming up in the next release. Thank you one more time @rafrafek for reporting it! |
|
This is now released under 2.27.1 version! |
Static type checker used
pyright/pylance
AWS Lambda function runtime
3.11
Powertools for AWS Lambda (Python) version
latest
Static type checker info
Pyright 1.1.331
Code snippet
Possible Solution
exc_info
should not bebool
only, it should be:"_ExcInfoType" which accepts:
"None"
"bool"
"tuple[type[BaseException], BaseException, TracebackType | None]"
"tuple[None, None, None]"
"BaseException"
The text was updated successfully, but these errors were encountered: