Nick Coghlan <ncogh...@gmail.com> added the comment:

This was discussed a little more in the python-dev thread for PEP 409, but both 
Guido and I have been burned in the past by badly written libraries that 
replaced detailed exceptions that explained *exactly* what was going wrong with 
bland, generic "it broke!" exceptions that told us nothing. What should have 
been a 5 minute fix turns into a long bug hunt because useful information was 
being thrown away.

With __context__ always being set, all you need to do to cope with 
inappropriate use of "raise X from None" by libraries is write your own 
exception handler that always reports the entire exception chain, regardless of 
the __cause__ setting. If "raise X from None" actually *clobbers* the context, 
though, you instead have to go in and try to get hold of the detailed exception 
information *before* it gets clobbered (which is a lot harder to do).

----------

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

Reply via email to