pybind11 v3.0.4 Release Notes
Release Date: 2026-04-19 // about 2 months ago-
🐛 Bug fixes:
🛠 Fixed test builds with installed Eigen 5 by improving
Eigen3CMake package detection.
#6036Fixed move semantics of
scoped_ostream_redirectto preserve buffered output and avoid crashes when moved redirects restore stream buffers.
#6033Fixed
py::dynamic_attr()traversal on Python 3.13+ to correctly propagatePyObject_VisitManagedDict()results.
#6032Fixed
std::shared_ptr<T>fallback casting to avoid unnecessary copy-constructor instantiation inreference_internalpaths.
#6028
CI:
Previous changes from v3.0.3
-
🐛 Bug fixes:
🛠 Fixed TSS key exhaustion in
implicitly_convertible()when many implicit conversions are registered across large module sets.
#6020🛠 Fixed heap-buffer-overflow in
pythonbufwith undersized buffers by enforcing a minimum buffer size.
#6019🛠 Fixed virtual-inheritance pointer offset crashes when dispatching inherited methods through virtual bases.
#6017Fixed
free(): invalid pointercrashes during interpreter shutdown withpy::enum_<>by duplicating late-addeddef_property_staticargument strings.
#6015Fixed
function_recordheap-type deallocation to callPyObject_Free()and decref the type.
#6010Hardened
PYBIND11_MODULE_PYINITandget_internals()against module-initialization crashes.
#6018Fixed
static_pointer_castbuild failure with virtual inheritance inholder_caster_foreign_helpers.h.
#6014🛠 Fixed ambiguous
factorytemplate specialization that caused compilation failures with nvcc + GCC 14.
#6011🛠 Fixed crash in
def_readwritefor non-smart-holder properties of smart-holder classes.
#6008Fixed memory leak for
py::dynamic_attr()objects on Python 3.13+ by clearing managed__dict__contents during deallocation.
#5999🛠 Fixed binding of
noexceptand ref-qualified (&,&&) methods inherited from unregistered base classes.
#5992
Internal:
🚚 Moved
tomlkitdependency to the dev dependency group.
#5990Switched to newer public CPython APIs (
PyType_GetFlagsand public vectorcall APIs where available).
#6005
✅ Tests:
- ✅ Made an async callback test deterministic by replacing fixed sleep with bounded waiting.
#5986
CI:
- ✅ Re-enabled Android tests in the cibuildwheel workflow.
#6001