-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
gh-137725: Convert faulthandler to Argument Clinic #137726
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
base: main
Are you sure you want to change the base?
Conversation
I don't understand this test failure. |
cpython/Modules/faulthandler.c Lines 1330 to 1333 in a10152f
Line 39 in a10152f
|
Ah, and it seems that static PyObject *
foo(PyObject *self, PyObject *args)
{
unsigned int a;
if (!PyArg_ParseTuple(args, "I", &a)) {
return NULL;
}
printf("a: %u\n", a);
Py_RETURN_NONE;
} >>> foo(-1)
a: 4294967295 Yuck. |
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
I fixed the Windows EXCEPTION constants by using |
Ok, the CI does now pass. The PR is now ready for a review :-) Sorry, I should have marked it as a draft in the beginning. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR includes also some behavior changes (constants are positive, negative arguments rejected), so I think it may need a NEWS entry.
Or you can keep the old behavior and change it in the following PR.
These changes only concern private functions and private constants, so I consider that they should not be documented. End users are not impacted, these functions and constants are only used by tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. 👍
PyObject *Py_UNUSED(ignored)) | ||
|
||
/*[clinic input] | ||
faulthandler.cancel_dump_traceback_later as faulthandler_cancel_dump_traceback_later_py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be:
faulthandler.cancel_dump_traceback_later as faulthandler_cancel_dump_traceback_later_py | |
faulthandler.cancel_dump_traceback_later |
if (PyModule_Add(module, "_EXCEPTION_ACCESS_VIOLATION", | ||
PyLong_FromUnsignedLong(EXCEPTION_ACCESS_VIOLATION))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a test that faulthandler._EXCEPTION_ACCESS_VIOLATION == 0xc0000005
, or at least that it is not negative?
Uh oh!
There was an error while loading. Please reload this page.