
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2014-03-01 16:35 byjlowin, last changed2022-04-11 14:57 byadmin. This issue is nowclosed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| issue20817.patch | jlowin,2014-03-01 16:38 | review | ||
| Messages (4) | |||
|---|---|---|---|
| msg212514 -(view) | Author: Jeremiah Lowin (jlowin)* | Date: 2014-03-01 16:35 | |
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 rangeExpected: TypeError: fn() missing 3 required positional arguments: 'a', 'b' and 'c' | |||
| msg212515 -(view) | Author: Jeremiah Lowin (jlowin)* | Date: 2014-03-01 16:38 | |
The bug is caused by a list of names not getting properly expanded when generating the error message. This patch fixes it (simply by adding a * in the appropriate place) and tests that a TypeError, not an IndexError, is raised. | |||
| msg214988 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2014-03-27 22:45 | |
New changeset35302cc4fc93 by Yury Selivanov in branch 'default':inspect: Fix getcallargs() to fail correctly if more than 3 args are missing.http://hg.python.org/cpython/rev/35302cc4fc93New changeset9f06cbb7962b by Yury Selivanov in branch '3.4':inspect: Fix getcallargs() to fail correctly if more than 3 args are missing.http://hg.python.org/cpython/rev/9f06cbb7962b | |||
| msg214989 -(view) | Author: Yury Selivanov (yselivanov)*![]() | Date: 2014-03-27 22:46 | |
Fixed for 3.4.1 and 3.5.Thanks for the contribution! | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:57:59 | admin | set | github: 65016 |
| 2014-03-27 22:46:06 | yselivanov | set | messages: +msg214989 |
| 2014-03-27 22:45:42 | python-dev | set | status: open -> closed nosy: +python-dev messages: +msg214988 resolution: fixed stage: resolved |
| 2014-03-01 18:39:44 | yselivanov | set | assignee:yselivanov nosy: +larry,yselivanov,ncoghlan |
| 2014-03-01 16:38:40 | jlowin | set | files: +issue20817.patch keywords: +patch messages: +msg212515 |
| 2014-03-01 16:35:04 | jlowin | create | |