[issue25532] infinite loop when running inspect.unwrap over unittest.mock.call

Hugo Geoffroy report at bugs.python.org
Mon Aug 22 00:40:38 EDT 2016


Hugo Geoffroy added the comment:

Another argument for having the fix in `unwrap` rather than `signature` is that this bug does not actually seem to be called by `signature`, as the doctest module calls `unwrap` for "inspect.isroutine(inspect.unwrap(val))".

Also, this call does not even check for `ValueError`, which, if I'm not wrong, is something that should be corrected.

Maybe `unwrap` could be made recursive to make it respect recursion limits directly ? Otherwise, limiting the loop seems like a good idea.

(Temporarily, `from mock import call; call.__wrapped__ = None` seems to be a good workaround to prevent infinite memory allocation).

----------

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


More information about the Python-bugs-list mailing list