New submission from Jeremiah Lowin: If inspect.getcallargs() is called on a function and three or more arguments are missing, an IndexError is raised instead of the expected TypeError.
This bug is present in Python 3.3 and 3.4.0 rc1 (5e05d7d3db9c). However, it worked as expected in Python 2.7.6. Example: >>> import inspect >>> def fn(a, b, c): >>> pass >>> inspect.getcallargs(fn) Result: IndexError: tuple index out of range Expected: TypeError: fn() missing 3 required positional arguments: 'a', 'b' and 'c' ---------- components: Library (Lib) messages: 212514 nosy: jlowin priority: normal severity: normal status: open title: inspect.getcallargs() raises the wrong error if 3+ arguments are missing type: behavior versions: Python 3.3, Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue20817> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com