Message382565
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. |
|
Date |
User |
Action |
Args |
2020-12-05 14:31:19 | kj | set | recipients:
+ kj, gvanrossum |
2020-12-05 14:31:19 | kj | set | messageid: <1607178679.27.0.947659385701.issue42576@roundup.psfhosted.org> |
2020-12-05 14:31:19 | kj | link | issue42576 messages |
2020-12-05 14:31:18 | kj | create | |
|