Repository navigation
Support Python 3.15 PyCArgObject struct layout changes. - #963
Merged
Merged
Conversation
Remove the temporary logic that skipped tests on Python 3.15. This logic was previously added to avoid `RuntimeError` during import due to `PyCArgObject` layout changes.
Update `util` to accommodate changes in the internal `PyCArgObject` structure introduced in Python 3.15. The `tag` field was changed from `c_char` to `c_char_p`, and the `size` field was changed from `c_int` to `c_ssize_t`. This change uses a version-based bridge to maintain backward compatibility with older Python versions.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## py_315_enum #963 +/- ##
==============================================
Coverage ? 89.16%
==============================================
Files ? 141
Lines ? 13793
Branches ? 0
==============================================
Hits ? 12299
Misses ? 1494
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
junkmd
force-pushed
the
py_315_cargobj
branch
from
October 11, 2026 00:05
c1f9bdf to
ded3f00
Compare
junkmd
marked this pull request as ready for review
October 11, 2026 00:24
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. Summary
This PR updates the internal
PyCArgObjectstruct layout incomtypes.utilto support Python 3.15.It introduces version-dependent ctypes definitions (
tagandsizefields) to maintain compatibility with Python 3.15 while preserving backward compatibility for Python 3.8–3.14.2. Motivation & Background
PyCArgObjectLayout Change (See Support Python 3.15PyCArgObjectlayout changes incomtypes.util#938):PyCArgObjectinctypes:tag: changed fromc_chartoc_char_psize: changed fromc_inttoc_ssize_tcomtypes.utilfail or causeRuntimeError/memory access issues during import or execution on Python 3.15.test_util.pycan be safely removed.