Skip to content

BUG: fix free-threaded PyObject layout in replace_scalar_type_names helper (#30686)#30702

Merged
charris merged 1 commit intonumpy:maintenance/2.4.xfrom
charris:backport-30686
Jan 21, 2026
Merged

BUG: fix free-threaded PyObject layout in replace_scalar_type_names helper (#30686)#30702
charris merged 1 commit intonumpy:maintenance/2.4.xfrom
charris:backport-30686

Conversation

@charris
Copy link
Member

@charris charris commented Jan 21, 2026

Backport of #30686.

Fixes #30681.

This function models the layout of PyObject and pokes at it via ctypes. It was poking at bits outside of tp_name on the free-threaded build. The fix is to model PyObject correctly on free-threading.

The layout of PyObject is different on 3.13t but the size is the same so this should still work there. I tested on 3.14.2t.

@charris charris added this to the 2.4.2 release milestone Jan 21, 2026
@charris charris added 00 - Bug 04 - Documentation 08 - Backport Used to tag backport PRs 39 - free-threading PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703) labels Jan 21, 2026
@charris charris merged commit 00f5aed into numpy:maintenance/2.4.x Jan 21, 2026
69 checks passed
@charris charris deleted the backport-30686 branch January 21, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

00 - Bug 04 - Documentation 08 - Backport Used to tag backport PRs 39 - free-threading PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants