Repository navigation
Align ctypes call ownership and C error state with Python 3.15 - #9218
youknowdot wants to merge 3 commits into
Conversation
Keep native raised errors separate from handled exceptions and preserve them across teardown callbacks. Import the related canonical ctypes call and type contracts. Assisted-by: OpenAI Codex: model version unavailable
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: :4: SyntaxWarning: invalid decimal literal dependencies:
dependent tests: (34 tests)
Legend:
|
Copy loader-owned names before Python filesystem decoding and update the related canonical ctypes utility and discovery tests from CPython 3.15. Preserve existing platform paths and dllist test markers. Assisted-by: OpenAI Codex: model version unavailable
Regenerate the pinned test through update_lib patches with reviewed marker data. Preserve other platform conditions and the unavailable extension-fixture guard. Assisted-by: OpenAI Codex: model version unavailable
Merging this PR will degrade performance by 13.4%
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
Summary
Extract the Python3.15 ctypes call-contract closure from #8954, with its required CAPI error-state dependency:
_ctypes.__getattr__behavior.The utility/dllist dependency is included: synchronous native enumeration on Linux and Android copies loader-owned names before Python decoding. Existing macOS/Windows paths are preserved; unsupported outer targets are not newly supported. Android uses the repository API24 baseline, above the loader API21 requirement. Contributor-owned sequence-repetition changes are not duplicated.
Validation
Current combined checkpoint 607e121
The initial hosted Linux run at 8e78504 failed with
test_ctypesENV CHANGED: the old Python/libffi dllist callback raised an unraisableValueError: PyObject is NULL, then the test skipped its missing extension fixture. Its automatic rerun reproduced the same environmental failure. The native dllist dependency removes that obsolete callback path.ListSharedLibrariesunder canonical unraisable/environment checking: system test passes, genuine missing_ctypes_testfixture skips,environment_altered=false. The fixture guard is retained.Historical constituent evidence
Standalone dllist on main eb2ffc6: fresh release, 1,401 workspace tests passed/18 ignored, 123 CAPI tests passed/4 ignored, both strict Clippy gates passed. Historical main58b54 fails the unchanged system-enumeration body with
Unsupported argument type; native candidate and oracle pass. Local Android runtime and OpenGL-loader coverage are not claimed.Original ctypes checkpoint 8e78504 (fresh sqlite+capi release):
_ctypes_testguard._ctypes.__getattr__(None/42/tuple)produced TypeError on sealed mega baseline and now matches the oracle's exact AttributeError/messages.Important provenance: mega already had the separate raised slot. The initial narrowed extraction omitted that dependency; it was restored before candidate runtime. The same PYFUNCTYPE inside-except probe passed on both mega and oracle, so this PR does not claim a newly reproduced mega conflation bug.
The native guard test checks storage nesting and Rust unwind. The Python teardown selections exercise real boundaries, but do not establish every nonempty-native-error reentrancy combination. No all-platform ABI or comprehensive callback/GC parity claim. Existing foreign-thread callback entry, callback conversion-error reporting, errcheck locking and incomplete callback metadata traversal remain separate limitations.
OpenAI Codex assisted with implementation, source review, canonical regeneration, automated validation and this PR description. The stated local checks were automated; this does not claim manual human testing. Prepared for the user's maintainer-directed Python3.15 upgrade work.