Skip to content

Conversation

methane
Copy link
Member

@methane methane commented May 25, 2023

This PR keeps ABIs like PyArg_Parse() raise SystemError.

At API level, PyArg_Parse is always replaced to _PyArg_Parse_Size_T by C macro regardless PY_SSIZE_T_CLEAN .


📚 Documentation preview 📚: https://cpython-previews--104923.org.readthedocs.build/

@methane methane added topic-C-API 3.13 bugs and security fixes labels May 25, 2023
@methane methane force-pushed the arg-ssize_t-by-default branch 5 times, most recently from f1b028c to f1141a1 Compare May 25, 2023 13:13
#ifdef PY_SSIZE_T_CLEAN
# define _PyObject_CallMethodId _PyObject_CallMethodId_SizeT
#endif

Copy link
Member Author

@methane methane May 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are not a part of stable ABI.
_PyObject_CallMethodId_SizeT is removed and _PyObject_CallMethodId is ssize_t version.

const char *format,
va_list va,
Py_ssize_t *p_nargs);
#endif
Copy link
Member Author

@methane methane May 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both of _Py_VaBuildStack and _Py_VaBuildStack_SizeT are remained, without macro alias.

/* Initialize event args now */
if (argFormat && argFormat[0]) {
eventArgs = _Py_VaBuildValue_SizeT(argFormat, vargs);
eventArgs = Py_VaBuildValue(argFormat, vargs);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sysmodule.c doesn't define PY_SSIZE_T_CLEAN, but Py_VaBuildValue is now alias to _Py_VaBuildValue_SizeT.

@methane methane force-pushed the arg-ssize_t-by-default branch from f1141a1 to b48b71a Compare May 25, 2023 13:23
@methane methane force-pushed the arg-ssize_t-by-default branch from b48b71a to 30a20f1 Compare May 25, 2023 13:26
@methane methane marked this pull request as ready for review May 25, 2023 14:29
@methane methane requested a review from markshannon as a code owner May 25, 2023 14:29
@methane methane marked this pull request as draft May 30, 2023 16:54
@methane methane closed this May 31, 2023
@methane methane deleted the arg-ssize_t-by-default branch April 28, 2025 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes topic-C-API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants