-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
bpo-40943: PY_SSIZE_T_CLEAN required for '#' formats #20784
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
Conversation
@methane @serhiy-storchaka: The feature is deprecated in Python 3.8 and Python 3.9. Are you ok to drop it now? Would you mind to review my PR? |
To compensate the shorter release cycle we should use longer deprecation period. Also, breaking changes in the C API have higher bar than breaking changes in Python code. Although I don't think that it will cause severe troubles in this case, because it is easy to write code which works with all supported Python versions, up to very old ones. But 2 years is just too little. |
@benjaminp and @brettcannon plan to update https://www.python.org/dev/peps/pep-0387/ to require 2 releases instead of 1 between the addition of DeprecationWarning and the removal of the feature, since Python release cycle is now 12 months instead of 18 months (https://www.python.org/dev/peps/pep-0602/). But here, the warning is already in 2 releases: Python 3.8 and Python 3.9, no? Note: I would prefer to make such incompatible changes at the beginning of the development cycle, to have more chances to discover issues in third party projects. So we will have more time to decide if the incompatible change must wait longer and so be reverted. |
The PY_SSIZE_T_CLEAN macro must now be defined to use PyArg_ParseTuple() and Py_BuildValue() "#" formats: "es#", "et#", "s#", "u#", "y#", "z#", "U#" and "Z#". See the PEP 353. Update _testcapi.test_buildvalue_issue38913().
I checked Cython and lxml. Cython always generate lxml test suite pass with this change (ignoring getiterator errors, unrelated to this PR). |
@serhiy-storchaka: I completed my PR to also change Py_BuildValue(). Would you mind to review the updated PR? |
If @serhiy-storchaka doesn't reply, I plan to merge this PR at the end of the week (friday). |
Thanks for the review @methane! I prefer to merge such incompatible change at the beginning of 3.10 dev cycle. |
The PY_SSIZE_T_CLEAN macro must now be defined to use PyArg_ParseTuple() and Py_BuildValue() "#" formats: "es#", "et#", "s#", "u#", "y#", "z#", "U#" and "Z#". See the PEP 353. Update _testcapi.test_buildvalue_issue38913().
The PY_SSIZE_T_CLEAN macro must now be defined to use PyArg_ParseTuple() and Py_BuildValue() "#" formats: "es#", "et#", "s#", "u#", "y#", "z#", "U#" and "Z#". See the PEP 353. Update _testcapi.test_buildvalue_issue38913().
The PY_SSIZE_T_CLEAN macro must now be defined to use
PyArg_ParseTuple() and Py_BuildValue() "#" formats: "es#", "et#",
"s#", "u#", "y#", "z#", "U#" and "Z#". See the PEP 353.
https://bugs.python.org/issue40943