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
Modules needing PY_SSIZE_T_CLEAN #52923
Comments
This is a list of extension modules making use of one of the "#" format codes ("s#", "y#", etc.) without defining PY_SSIZE_T_CLEAN, and therefore being 64-bit unclean: Modules/audioop.c |
The documentation says that sometimes in the future Py_ssize_t will be the default, so we may also need some kind of transition period for non-complying third-party extensions; first with warnings and then with errors perhaps. |
I personally don't think that a transition period would be a useful thing to have, in particular not if it goes like this:
So I'd rather drop PY_SSIZE_T clean altogether from 3.2, and risk any breakage that this may cause. |
Mark just fixed audioop in bpo-8675 |
And the curses module was made PY_SSIZE_T_CLEAN in r81085 (a very simple change). |
Is there any reason why you reported zlibmodule.c separately in bpo-8650 (other than maybe finding that first), and for 4 versions there versus 1 here? Should this supersede that? |
Because zlibmodule.c has more 64-bitness issues than just PY_SSIZE_T_CLEAN (see bug description).
No. |
Given the rise of the 64 bit machine I'd guess that this needs completing sooner rather than later. I'd volunteer myself but I've never heard of the '#' format codes, let alone know anything about them :-( |
zlibmodule_ssize_t_clean.patch: Patch to make the zlib module "ssize_t clean". The patch just defines PY_SSIZE_T_CLEAN, no "#" format is used. "./python -m test -v test_zlib" test pass on my 64-bit Linux. |
I just created the issue bpo-21780 to make the unicodedata module 64-bit safe. |
I created the issue bpo-21781 to make the _ssl module 64-bit clean. |
New changeset 691ca1694fe7 by Victor Stinner in branch '3.4': New changeset 45dcdd8f3211 by Victor Stinner in branch 'default': |
Modules/_gdbmmodule.c They use '#' without PY_SSIZE_T_CLEAN yet. |
Also PC/winreg.c. In this case winreg.SetValue() needs a length of size DWORD instead of ssize_t. |
Would it be possible to emit a deprecation warning, maybe at runtime, when PY_SSIZE_T_CLEAN is not defined? |
As MSDN, cbData is ignored. Can I skip overflow check? If I can not, what is DWORD_MAX? (INT_MAX?) |
New changeset c5a216e by Inada Naoki in branch 'master': |
New changeset d5f18a6 by Inada Naoki in branch 'master': |
if (value_length >= INT_MAX) {
PyErr_SetString(PyExc_OverflowError,
"the value is too long");
return NULL;
} PY_DWORD_MAX should be used here. It's twice larger than INT_MAX ;-) |
I created bpo-36381 for it. Let's close this long living issue. |
Thanks INADA-san for fixing last issues and for creating the deprecation issue! |
Thank you for doing this Inada-san! |
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: