This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jlowin
Recipients jlowin
Date 2014-03-01.16:35:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1393691704.85.0.0636600891648.issue20817@psf.upfronthosting.co.za>
In-reply-to
Content
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'
History
Date User Action Args
2014-03-01 16:35:04jlowinsetrecipients: + jlowin
2014-03-01 16:35:04jlowinsetmessageid: <1393691704.85.0.0636600891648.issue20817@psf.upfronthosting.co.za>
2014-03-01 16:35:04jlowinlinkissue20817 messages
2014-03-01 16:35:04jlowincreate