Ethan Furman <et...@stoneleaf.us> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39717>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to