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 kj
Recipients gvanrossum, kj
Date 2020-12-05.14:31:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1607178679.27.0.947659385701.issue42576@roundup.psfhosted.org>
In-reply-to
Content
I noticed that passing keyword arguments to types.GenericAlias's __new__ causes the interpreter to hard crash and exit due to an assertion failure:

import types
types.GenericAlias(bad=float)


Result:
Assertion failed: PyTuple_CheckExact(kwnames), file ....\cpython\Python\getargs.c, line 2767

A simple fix is to just use _PyArg_NoKeywords instead of _PyArg_NoKwnames. 

Looking through the rest of the C code, it seems that apart from GenericAlias, only vectorcalls for various builtins use _PyArg_NoKwnames. However, they don't seem to be affected by the bug.
History
Date User Action Args
2020-12-05 14:31:19kjsetrecipients: + kj, gvanrossum
2020-12-05 14:31:19kjsetmessageid: <1607178679.27.0.947659385701.issue42576@roundup.psfhosted.org>
2020-12-05 14:31:19kjlinkissue42576 messages
2020-12-05 14:31:18kjcreate