Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue7853

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:on __exit__(), exc_value does not contain the exception.
Type:behaviorStage:patch review
Components:Interpreter CoreVersions:Python 2.7, Python 2.6
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To: benjamin.petersonNosy List: benjamin.peterson, flox, pitrou
Priority:highKeywords:patch

Created on2010-02-04 09:35 byflox, last changed2022-04-11 14:56 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
case_contextmanager_exit.pyflox,2010-02-04 09:37
issue7853_cm_exit.diffflox,2010-02-05 00:40Patch, apply to trunk
Messages (7)
msg98817 -(view)Author: Florent Xicluna (flox)*(Python committer)Date: 2010-02-04 09:35
On __exit__(), the 3rd argument "exc_value" should contain the instance of the exception.But in most cases, it contains only the string representation of the exception.See attached test case.Same behavior for KeyError, AttributeError, RuntimeError, ...
msg98833 -(view)Author: Antoine Pitrou (pitrou)*(Python committer)Date: 2010-02-04 12:47
Indeed, it seems the exception isn't always normalized.
msg98834 -(view)Author: Benjamin Peterson (benjamin.peterson)*(Python committer)Date: 2010-02-04 12:48
Has this behavior changed between 2.6 and 2.7?
msg98835 -(view)Author: Antoine Pitrou (pitrou)*(Python committer)Date: 2010-02-04 12:52
No, it's also in 2.6.
msg98860 -(view)Author: Florent Xicluna (flox)*(Python committer)Date: 2010-02-05 00:40
Patch.
msg98863 -(view)Author: Benjamin Peterson (benjamin.peterson)*(Python committer)Date: 2010-02-05 02:12
Fixed inr77983.
msg98928 -(view)Author: Benjamin Peterson (benjamin.peterson)*(Python committer)Date: 2010-02-06 02:03
BTW, I'm not going to backport this fix, since the implementation does carry over well to 2.6. Additionally, it is probably an unacceptable change of behavior in a bug fix release.
History
DateUserActionArgs
2022-04-11 14:56:57adminsetgithub: 52101
2010-02-06 02:03:18benjamin.petersonsetmessages: +msg98928
2010-02-05 02:12:53benjamin.petersonsetstatus: open -> closed
resolution: fixed
messages: +msg98863
2010-02-05 00:40:14floxsetfiles: +issue7853_cm_exit.diff
keywords: +patch
messages: +msg98860

stage: test needed -> patch review
2010-02-04 21:24:57benjamin.petersonsetassignee:benjamin.peterson
2010-02-04 12:52:28pitrousetmessages: +msg98835
2010-02-04 12:48:51benjamin.petersonsetmessages: +msg98834
2010-02-04 12:47:07pitrousetnosy: +pitrou,benjamin.peterson
messages: +msg98833
2010-02-04 09:37:57floxsetfiles: +case_contextmanager_exit.py
2010-02-04 09:37:49floxsetfiles: -case_contextmanager_exit.py
2010-02-04 09:35:08floxcreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp