Skip to content

[3.13] gh-76595: Add tests for PyCapsule_Import() (GH-154588) - #154621

Merged
serhiy-storchaka merged 1 commit into
python:3.13from
serhiy-storchaka:backport-d24d9d0-3.13
Jul 24, 2026
Merged

[3.13] gh-76595: Add tests for PyCapsule_Import() (GH-154588)#154621
serhiy-storchaka merged 1 commit into
python:3.13from
serhiy-storchaka:backport-d24d9d0-3.13

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jul 24, 2026

Copy link
Copy Markdown
Member

PyCapsule_Import() was only exercised by the best-effort loop in the test_capsule C self-test.

Add _testlimitedcapi helpers to create a capsule with an arbitrary name and to call PyCapsule_Import() from Python, and tests covering the current behavior, including error cases and non-ASCII, non-UTF-8 and NULL names.

(cherry picked from commit d24d9d0)

🤖 Generated with Claude Code

Add _testcapi helpers to create a capsule with an arbitrary name and to call PyCapsule_Import(), and Python tests covering the current behavior: only the first component of the dotted name is imported, the rest are attribute lookups.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit d24d9d0)
@serhiy-storchaka
serhiy-storchaka requested a review from a team as a code owner July 24, 2026 15:10
@serhiy-storchaka
serhiy-storchaka enabled auto-merge (squash) July 24, 2026 15:12
@serhiy-storchaka
serhiy-storchaka merged commit d68610b into python:3.13 Jul 24, 2026
42 checks passed
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.

1 participant