-
-
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.
If repeat is True, the tracebacks of all threads are dumped every timeout seconds. | ||
If exit is true, call _exit(1) which is not safe. |
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.
"True" or "true"?
/*[clinic input] | ||
faulthandler._raise_exception | ||
code: unsigned_int |
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.
"I" means unsigned_int(biwise=True)
. It accepts negative and positive values.
Uh oh!
There was an error while loading. Please reload this page.