-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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
logging exc_info parameter should accept exception instances #64736
Comments
A bunch of logging methods accept optional parameter exc_info, that is supposed to be either 'True' or a tuple of three elements (type, exc, tb). If, however, someone passes an actual exception instance, Logger._log function will interpret it as True and get the current exception from sys.exc_info, ignoring the passed exception completely. Attached is a patch that fixes this: if exc_info is an instance of BaseException, Logger._log creates the tuple out of it automatically. |
I believe it's too late for feature changes in 3.4, so removing it from versions. |
It would be good if the patch addressed documentation changes, too :-) |
Alright. Was worth a try ;)
Sure, I'll add the documentation, when we start working on 3.5. Are you OK with the general idea of the patch? |
Yes - or I would have said something :-) |
Vinay, Please take a look at the second patch -- 'logging_02.patch' -- with updated docs |
New changeset 9d54903a84b5 by Vinay Sajip in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: