You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Argument Clinic omits name of keyword-only parameter on _PyArg_BadArgument() call #81215
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2019-08-29.15:52:22.139>created_at=<Date2019-05-24.10:29:45.200>labels= ['interpreter-core', 'type-bug', '3.8', '3.9']
title='Argument Clinic omits name of keyword-only parameter on _PyArg_BadArgument() call'updated_at=<Date2019-08-29.16:37:39.240>user='https://github.com/vstinner'
>>> deff(): pass
...
>>> code = f.__code__
>>> code.replace(co_lnotab=4)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: replace() argument 'co_lnotab' must be bytes, not int
New changeset 4901fe2 by Serhiy Storchaka (Rémi Lapeyre) in branch 'master': bpo-37034: Display argument name on errors with keyword arguments with Argument Clinic. (GH-13593) 4901fe2
New changeset 96631dc by Serhiy Storchaka in branch '3.8':
[3.8] bpo-37034: Display argument name on errors with keyword arguments with Argument Clinic. (GH-13593). (GH-15599) 96631dc
Activity
vstinner commentedon May 24, 2019
Example of generated code:
Error message:
TypeError: replace() argument 16 must be bytes, not tuple
It is the 'lnotab' parameter which is a keywoard-only parameter. I expect the parameter name in the error message.
Note: I got this error while implementing bpo-37032.
remilapeyre commentedon May 27, 2019
With the attached PR, the error message is now:
serhiy-storchaka commentedon Jun 5, 2019
This is a bug. I intentionally committed the simpler code, but forgot to fix it later.
vstinner commentedon Jun 5, 2019
I suggest to also apply the fix to 3.8 in that case.
serhiy-storchaka commentedon Aug 29, 2019
New changeset 4901fe2 by Serhiy Storchaka (Rémi Lapeyre) in branch 'master':
bpo-37034: Display argument name on errors with keyword arguments with Argument Clinic. (GH-13593)
4901fe2
serhiy-storchaka commentedon Aug 29, 2019
New changeset 96631dc by Serhiy Storchaka in branch '3.8':
[3.8] bpo-37034: Display argument name on errors with keyword arguments with Argument Clinic. (GH-13593). (GH-15599)
96631dc
serhiy-storchaka commentedon Aug 29, 2019
Thank you Rémi!
vstinner commentedon Aug 29, 2019
Thanks, that's a great enhancement!