NumPy 2.5.3 Release Notes#

The NumPy 2.5.3 is a patch release that fixes bugs discovered after the 2.5.2 release. Apart from the usual bug and maintenance work, there are a number of StringDType related fixes for problems discovered during the ongoing string work in the main branch.

This release supports Python versions 3.12-3.15

Changes#

  • Casting a fixed-width byte string array (np.bytes_) to StringDType now raises TypeError when the bytes are not valid UTF-8. Previously the invalid bytes were stored as-is and later caused undefined behavior in string operations.

    (gh-32296)

  • MaskedArray._fill_value would become stale when ufuncs that change dtype left the result holding a fill_value typed for the old dtype. The mismatch was silent until something later called _check_fill_value, such as .view(), and then a TypeError would be raised. Now, when the copied fill_value is no longer valid for the new dtype, fall back to the default fill_value for that dtype instead of propagating the stale value. This may raise a ComplexWarning if the fill_value is complex and the new dtype is real.

    (gh-32423)

Contributors#

A total of 9 people contributed to this release. People with a “+” by their names contributed a patch for the first time.

  • Charles Harris

  • Iason Krommydas

  • James Davies +

  • Joren Hammudoglu

  • Maanas Arora

  • Matti Picus

  • Nathan Goldbaum

  • Shikhar Goel +

  • Yeonho Kim +

Pull requests merged#

A total of 27 pull requests were merged for this release.

  • #32235: MAINT: Prepare 2.5.x for further development

  • #32289: BUG: raise ValueError when reading into record array with references…

  • #32290: BUG: avoid uninitialized memory access / NULL-pointer deref in…

  • #32291: TYP: fix np.random.{get,set}_bit_generator implicit re-exports…

  • #32292: BUG: don’t assume strides are a multiple of itemsize in stringdtype…

  • #32293: CI: fix ccache CC override, add CXX in mac Conda CI (#32285)

  • #32303: BUG: Fix ref leak in _convert_from_type for custom scalar types…

  • #32304: BUG: fix a number of issues around iterators and StringDType…

  • #32326: TST: avoid allocating huge tuple of arrays in concatenate test…

  • #32338: BUG: avoid possible UB in ‘safe’ multiplication helpers (#32294)

  • #32339: MAINT: use PyObject_ functions instead of raw PyArray_ ones (#32331)

  • #32378: BUG: validate UTF-8 and harden StringDType bounds handling (#32296)

  • #32380: BUG: fix two error handling mistakes in stringdtype replace loop…

  • #32381: BUG: fix visibility annotations for functions in StringDType…

  • #32384: MAINT: Update ml_dtypes pin to 8/21/2026.

  • #32385: MAINT: Update numpy/_core/src/umath/svml

  • #32410: MAINT: skip failing cython limited API tests on Cython 3.3.0…

  • #32427: BUG: close duplicated file descriptor if fdopen fails (#32386)

  • #32428: MAINT: add missing space in warning and error messages (#32405)

  • #32430: BUG: fix error handling in StringDType to fixed-width bytes case…

  • #32441: MAINT: Only run nightly BLAS tests on main.

  • #32471: BUG: fix memory leak in StringDType creation error path (#32470)

  • #32477: BUG: fix stale fill_value after ufuncs change MaskedArray dtype…

  • #32478: MAINT: exit deadlock tests quickly on slow hardware (#32466)

  • #32481: BUG: Backport StringDType byteorder fixes

  • #32506: DOC: use static scipy doc site for intershpinx (#32503)

  • #32509: BUG: fix crash in ufunc.resolve_dtypes with a Python scalar type…