-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Passing keyword arguments to types.GenericAlias causes a hard crash #86742
Comments
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: 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. |
Oh, this looks like I copied the wrong idiom. Good catch! |
Thanks for the quick fix! |
Thanks for taking the time to review this! I forgot to specify this only affects debug builds in the news entry. I'm opening a PR to edit that because I don't want people to mistake it for an actual interpreter-crashing bug in the release build (that would probably cause some amount of unneeded worry). |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: