mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
Fix: Prevent crash in ctypes.CField when byte_size does not match type size (gh-132470) When creating a ctypes.CField with an incorrect byte_size (e.g., using `byte_size=2` for `ctypes.c_byte`), the code would previously abort due to the failed assertion `byte_size == info->size`. This commit replaces the assertion with a proper error handling mechanism that raises a `ValueError` when `byte_size` does not match the expected type size. This prevents the crash and provides a more informative error message to the us Co-authored-by: sobolevn <mail@sobolevn.me> |
||
|---|---|---|
| .. | ||
| 2024-12-31-15-28-14.gh-issue-50333.KxQUXa.rst | ||
| 2025-01-08-18-55-57.gh-issue-112068.ofI5Fl.rst | ||
| 2025-04-13-20-52-39.gh-issue-132470.UqBQjN.rst | ||
| README.rst | ||
Put news entry `blurb`_ files for the *C API* section in this directory. .. _blurb: https://pypi.org/project/blurb/