Issue 19720: suppress context for some exceptions in importlib? (original) (raw)

Issue19720

Created on 2013-11-22 18:36 by eric.snow, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
importlib_suppress_context.patch serhiy.storchaka,2014-11-19 08:54 review
Messages (6)
msg203830 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2013-11-22 18:36
Some exceptions in importlib are raised from within except blocks, resulting in chained tracebacks. [1] For at least some of these we should consider suppressing the exception context. For example (for [1]): try: path = parent_module.__path__ except AttributeError: msg = (_ERR_MSG + '; {} is not a package').format(name, parent) raise ImportError(msg, name=name) from None [1] http://hg.python.org/cpython/file/default/Lib/importlib/_bootstrap.py#l2088
msg231361 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-11-19 08:54
Yes, suppressing context was introduced for such cases. Here is a patch.
msg231476 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2014-11-21 15:53
LGTM
msg231488 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-11-21 18:36
New changeset 2de3c659a979 by Serhiy Storchaka in branch 'default': Issue #19720: Suppressed context for some exceptions in importlib. https://hg.python.org/cpython/rev/2de3c659a979
msg231493 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-11-21 20:00
New changeset 8f77f7bb46c7 by Serhiy Storchaka in branch 'default': Issue #19720: Suppressed context for some exceptions in importlib. https://hg.python.org/cpython/rev/8f77f7bb46c7
msg231497 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-11-21 20:04
Sorry, 8f77f7bb46c7 is related to , not this issue. I have copied wrong commit message from clipboard.
History
Date User Action Args
2022-04-11 14:57:54 admin set github: 63919
2014-11-21 20:04:12 serhiy.storchaka set messages: +
2014-11-21 20:00:16 python-dev set messages: +
2014-11-21 20:00:03 serhiy.storchaka set status: open -> closedresolution: fixedstage: commit review -> resolved
2014-11-21 18:36:26 python-dev set nosy: + python-devmessages: +
2014-11-21 15:53:22 brett.cannon set assignee: brett.cannon -> serhiy.storchakamessages: + stage: patch review -> commit review
2014-11-19 15:29:33 brett.cannon set assignee: brett.cannon
2014-11-19 08:54:40 serhiy.storchaka set files: + importlib_suppress_context.patchnosy: + serhiy.storchakamessages: + keywords: + patchstage: needs patch -> patch review
2013-11-22 18:36:50 eric.snow create