[issue30459] PyList_SET_ITEM could be safer

Espie Marc report at bugs.python.org
Sat Dec 5 04:20:31 EST 2020


Espie Marc <espie at nerim.net> added the comment:

On Sat, Dec 05, 2020 at 01:28:33AM +0000, STINNER Victor wrote:
> 
> STINNER Victor <vstinner at python.org> added the comment:
> 
> I propose to merge my PR 23645 change right now. If it breaks too many C extensions, we still have time before Python 3.10.0 final scheduled at Monday, 2021-10-04, to revert the change.
> 
> 
> "if (obj == NULL || PyList_SET_ITEM (l, i, obj) < 0)"
> 
> Well, this is obviously a bug in py-qt4 and it's a good thing to get a compiler error on such code. I guess that the intent was to use PyList_SetItem().
> 
> It's also an issue for Python implementation other than CPython which does not behave exactly like CPython C API. I prefer to fix the C API to make it respect its own documentation (return "void").
> 
> 
> Espie Marc: "Well, there is not going to be a lot of breakage. This problem is the only instance I've encountered in the full OpenBSD ports tree."
> 
> Oh, thanks for providing this very useful feedback! That's very promising.
> 
> Did you report the issue to py-qt4 upstream? If yes, can you please copy here the link to your report?

I'm sorry, it's been so long ago, I can't remember.

I've been dealing with 10s of other bugs since.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue30459>
_______________________________________


More information about the Python-bugs-list mailing list