[issue25998] doctest crashes when accessing __wrapped__ fails other than AttributeError

Steven D'Aprano report at bugs.python.org
Sat Jan 2 18:43:35 EST 2016


Steven D'Aprano added the comment:

doctest doesn't crash -- it is a regular exception, not a crash. "Crash" means "Hard crashes of the Python interpreter – possibly with a core dump or a Windows error box." In other words, a segmentation fault or other low-level crash, not an exception.

I'm not convinced that this is a problem with doctest, it looks to me like a broken-by-design flaw in requests. If you try to access an attribute that doesn't exist, you should get AttributeError, not RuntimeError. I don't understand the justification given on the requests tracker for why the attribute access fails, but I would expect that any exception other than AttributeError, or a subclass of such, is a clear bug in requests.

I don't think it is doctest's responsibility to have special handling for an ill-designed proxy class, but I'll hold off closing the ticket for a few days in case anyone makes a good argument for why this is a doctest bug.

----------
nosy: +steven.daprano
type: crash -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25998>
_______________________________________


More information about the Python-bugs-list mailing list