Skip to content

Conversation

@charris
Copy link
Member

@charris charris commented Sep 23, 2025

Backport of #29715.

This PR fixes a refcount bug raised in #29707 and adds a test which fails on main branch for linux, x86.

  • BUG: Fix dtype refcount in __array__

  • Consider all possible code paths

  • Remove else-if branch

  • Move refcount checks to a separate test

  • Add code comments

  • Add missing Py_DECREF for error path

  • Apply review comments

* BUG: Fix `dtype` refcount in `__array__`

* Consider all possible code paths

* Remove else-if branch

* Move refcount checks to a separate test

* Add code comments

* Add missing `Py_DECREF` for error path

* Apply review comments
@charris charris added 00 - Bug 08 - Backport Used to tag backport PRs labels Sep 23, 2025
@charris charris merged commit e1086a8 into numpy:maintenance/2.3.x Sep 23, 2025
75 checks passed
@charris charris deleted the backport-29715 branch September 23, 2025 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

00 - Bug 08 - Backport Used to tag backport PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants