Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue20537

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:logging exc_info parameter should accept exception instances
Type:enhancementStage:resolved
Components:Versions:Python 3.5
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To: vinay.sajipNosy List: python-dev, vinay.sajip, yselivanov
Priority:normalKeywords:patch

Created on2014-02-06 23:53 byyselivanov, last changed2022-04-11 14:57 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
logging_01.patchyselivanov,2014-02-06 23:53review
logging_02.patchyselivanov,2014-09-12 23:07review
Messages (7)
msg210428 -(view)Author: Yury Selivanov (yselivanov)*(Python committer)Date: 2014-02-06 23:53
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.
msg210436 -(view)Author: Vinay Sajip (vinay.sajip)*(Python committer)Date: 2014-02-07 06:36
I believe it's too late for feature changes in 3.4, so removing it from versions.
msg210437 -(view)Author: Vinay Sajip (vinay.sajip)*(Python committer)Date: 2014-02-07 06:38
It would be good if the patch addressed documentation changes, too :-)
msg210554 -(view)Author: Yury Selivanov (yselivanov)*(Python committer)Date: 2014-02-07 20:54
> I believe it's too late for feature changes in 3.4, so removing it from versions.Alright. Was worth a try ;)> It would be good if the patch addressed documentation changes, too :-)Sure, I'll add the documentation, when we start working on 3.5.Are you OK with the general idea of the patch?
msg210559 -(view)Author: Vinay Sajip (vinay.sajip)*(Python committer)Date: 2014-02-07 21:29
Yes - or I would have said something :-)
msg226851 -(view)Author: Yury Selivanov (yselivanov)*(Python committer)Date: 2014-09-12 23:07
Vinay,Please take a look at the second patch -- 'logging_02.patch' -- with updated docs
msg226886 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2014-09-14 20:29
New changeset9d54903a84b5 by Vinay Sajip in branch 'default':Closes#20537: logging methods now accept an exception instance as well as a Boolean value or exception tuple. Thanks to Yury Selivanov for the patch.https://hg.python.org/cpython/rev/9d54903a84b5
History
DateUserActionArgs
2022-04-11 14:57:58adminsetgithub: 64736
2014-09-14 20:29:31python-devsetstatus: open -> closed

nosy: +python-dev
messages: +msg226886

resolution: fixed
stage: resolved
2014-09-12 23:07:27yselivanovsetfiles: +logging_02.patch

messages: +msg226851
2014-02-07 21:29:27vinay.sajipsetmessages: +msg210559
2014-02-07 20:54:24yselivanovsetmessages: +msg210554
2014-02-07 06:38:54vinay.sajipsetmessages: +msg210437
2014-02-07 06:36:44vinay.sajipsetassignee:vinay.sajip
messages: +msg210436
versions: - Python 3.4
2014-02-06 23:53:08yselivanovcreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp