]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-76963: PEP3118 itemsize of an empty ctypes array should not be 0 (GH-5576)
authorEric Wieser <wieser.eric@gmail.com>
Fri, 23 Dec 2022 08:23:19 +0000 (08:23 +0000)
committerGitHub <noreply@github.com>
Fri, 23 Dec 2022 08:23:19 +0000 (08:23 +0000)
commit84bc6a4f25fcf467813ee12b74118f7b1b54e285
treed5ec734fae7968f0073f5769d3575b7173038096
parent73c08eeaffadb73184808e462792b6793ce9f82d
gh-76963: PEP3118 itemsize of an empty ctypes array should not be 0 (GH-5576)

The itemsize returned in a memoryview of a ctypes array is now computed from the item type, instead of dividing the total size by the length and assuming that the length is not zero.
Lib/test/test_ctypes/test_pep3118.py
Misc/NEWS.d/next/Core and Builtins/2018-02-06-23-21-13.bpo-32782.EJVSfR.rst [new file with mode: 0644]
Modules/_ctypes/_ctypes.c