This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ethan.furman
Recipients cool-RR, ethan.furman, rhettinger
Date 2020-02-22.02:02:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1582336956.89.0.506193413857.issue39717@roundup.psfhosted.org>
In-reply-to
Content
I know we are not in the habit of making large-scale changes to take advantage of new features and enhancements, but I think this may be one of the few exceptions to the rule, and it has to do with what the text between the two tracebacks means:

-----
"During handling of the above exception, another exception occurred:"

-> there is a bug in the exception handler.
-----

-----
"The above exception was the direct cause of the following exception:"

-> the first error is the cause and the second error is what we want the user to pay attention to.
-----

Whether or not the stdlib is buggy is a pretty big distinction.

If this is a change worth making the follow-on question is should we be raising from the previous exception, or from None?  How much value is the previous exception adding?

In cases where the new exception contains the text of the old one I think `from None` should be preferred; in cases where import errors get translated into CompressionErrors those import errors are sometimes useful and sometimes just noise -- perhaps including `str(e)` in the new exception is the best way there as well.

I'll need to do some research before I decide.
History
Date User Action Args
2020-02-22 02:02:36ethan.furmansetrecipients: + ethan.furman, rhettinger, cool-RR
2020-02-22 02:02:36ethan.furmansetmessageid: <1582336956.89.0.506193413857.issue39717@roundup.psfhosted.org>
2020-02-22 02:02:36ethan.furmanlinkissue39717 messages
2020-02-22 02:02:36ethan.furmancreate