FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.12] gh-62260: Fix ctypes.Structure subclassing with multiple layers (GH-13374) by serhiy-storchaka · Pull Request #113623 · python/cpython · GitHub

Repository navigation

[3.12] gh-62260: Fix ctypes.Structure subclassing with multiple layers (GH-13374) - #113623

Merged
serhiy-storchaka merged 3 commits into
python:3.12from
serhiy-storchaka:backport-5f3cc90-3.12
Jan 5, 2024
Merged

serhiy-storchaka merged 3 commits into
python:3.12from
serhiy-storchaka:backport-5f3cc90-3.12

Conversation

serhiy-storchaka commented Jan 1, 2024 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

The length field of StgDictObject for Structure class contains now the total number of items in ffi_type_pointer.elements (excluding the trailing null).

The old behavior of using the number of elements in the parent class can cause the array to be truncated when it is copied, especially when there are multiple layers of subclassing.

(cherry picked from commit 5f3cc90)

… layers (pythonGH-13374)

The length field of StgDictObject for Structure class contains now
the total number of items in ffi_type_pointer.elements (excluding
the trailing null).

The old behavior of using the number of elements in the parent class can
cause the array to be truncated when it is copied, especially when there
are multiple layers of subclassing.

(cherry picked from commit 5f3cc90)

Co-authored-by: Jeffrey Kintscher <49998481+websurfer5@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka merged commit 6d9af66 into python:3.12 Jan 5, 2024
serhiy-storchaka deleted the backport-5f3cc90-3.12 branch February 19, 2024 18:22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL