cpython/Modules/_ctypes
Miss Islington (bot) 17f61ed25a
bpo-37140: Fix StructUnionType_paramfunc() (GH-15612)
Fix a ctypes regression of Python 3.8. When a ctypes.Structure is
passed by copy to a function, ctypes internals created a temporary
object which had the side effect of calling the structure finalizer
(__del__) twice. The Python semantics requires a finalizer to be
called exactly once. Fix ctypes internals to no longer call the
finalizer twice.

Create a new internal StructParam_Type which is only used by
_ctypes_callproc() to call PyMem_Free(ptr) on Py_DECREF(argument).
StructUnionType_paramfunc() creates such object.
(cherry picked from commit 96b4087ce7)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-08-30 05:50:44 -07:00
..
darwin Recorded merge of revisions 81032 via svnmerge from 2010-05-09 16:14:21 +00:00
libffi_osx Remove wording that could be deemed to be perjorative (GH-9287) 2018-09-13 21:17:40 -07:00
_ctypes.c bpo-37140: Fix StructUnionType_paramfunc() (GH-15612) 2019-08-30 05:50:44 -07:00
_ctypes_test.c bpo-36594: Fix incorrect use of %p in format strings (GH-12769) 2019-05-06 12:56:50 -04:00
_ctypes_test.h Copy ctypes-0.9.9.4 sources from external into the trunk. 2006-03-08 19:35:11 +00:00
callbacks.c bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async (GH-13464) 2019-05-30 19:13:39 -07:00
callproc.c bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async (GH-13464) 2019-05-30 19:13:39 -07:00
cfield.c bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async (GH-13464) 2019-05-30 19:13:39 -07:00
ctypes.h fix a PY_LONG_LONG straggler 2016-09-08 09:25:03 -07:00
ctypes_dlfcn.h Remove outdated PEP 291 compatibility requirement comment 2016-05-14 05:55:38 +00:00
malloc_closure.c bpo-36071 Add support for Windows ARM32 in ctypes/libffi (GH-12059) 2019-04-17 18:09:16 -07:00
stgdict.c bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async (GH-13464) 2019-05-30 19:13:39 -07:00