Commit 63bb23d
authored
chore(deps): update rust crate pyo3 to 0.29 [security] (#149)
> ℹ️ **Note**
>
> This PR body was truncated due to platform limits.
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [pyo3](https://redirect.github.com/pyo3/pyo3) | workspace.dependencies
| minor | `0.22` → `0.29` |
---
### PyO3 Risk of buffer overflow in `PyString::from_object`
[GHSA-pph8-gcv7-4qj5](https://redirect.github.com/advisories/GHSA-pph8-gcv7-4qj5)
<details>
<summary>More information</summary>
#### Details
`PyString::from_object` took `&str` arguments and forwarded them
directly to the Python C API without checking for terminating nul bytes.
This could lead the Python interpreter to read beyond the end of the
`&str` data and potentially leak contents of the out-of-bounds read (by
raising a Python exception containing a copy of the data including the
overflow).
In PyO3 0.24.1 this function will now allocate a `CString` to guarantee
a terminating nul bytes. PyO3 0.25 will likely offer an alternative API
which takes `&CStr` arguments.
#### Severity
- CVSS Score: 2.9 / 10 (Low)
- Vector String:
`CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:P`
#### References
-
[https://github.com/PyO3/pyo3/issues/5005](https://redirect.github.com/PyO3/pyo3/issues/5005)
-
[https://github.com/PyO3/pyo3/pull/5008](https://redirect.github.com/PyO3/pyo3/pull/5008)
-
[https://rustsec.org/advisories/RUSTSEC-2025-0020.html](https://rustsec.org/advisories/RUSTSEC-2025-0020.html)
-
[https://github.com/advisories/GHSA-pph8-gcv7-4qj5](https://redirect.github.com/advisories/GHSA-pph8-gcv7-4qj5)
This data is provided by the [GitHub Advisory
Database](https://redirect.github.com/advisories/GHSA-pph8-gcv7-4qj5)
([CC-BY
4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>
---
### PyO3 has an Out-of-bounds Read in `nth` / `nth_back` for `PyList`
and `PyTuple` iterators
[GHSA-36hh-v3qg-5jq4](https://redirect.github.com/advisories/GHSA-36hh-v3qg-5jq4)
<details>
<summary>More information</summary>
#### Details
PyO3 0.24.0 added optimized implementations of `Iterator::nth` and
`DoubleEndedIterator::nth_back` for the `BoundListIterator` and
`BoundTupleIterator` types. These implementations computed the target
index using unchecked `usize` addition (`index + n`) before
bounds-checking against the sequence length, then read the element via
`get_item_unchecked`.
In `nth` methods, a sufficiently large `n` (combined with a non-zero
internal index) could cause the addition to overflow and wrap around,
producing a small "target index" that passed the bounds check and
enabling reads at the front of the `list` or `tuple` of elements
previously yielded by the iterator.
In `nth_back` methods, a sufficiently large `n` could cause underflow in
a similar fashion, however would instead allow reads of arbitrary memory
past the end of the `list` or `tuple` storage.
#### Severity
- CVSS Score: 8.7 / 10 (High)
- Vector String:
`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N`
#### References
-
[https://github.com/PyO3/pyo3/pull/6086](https://redirect.github.com/PyO3/pyo3/pull/6086)
-
[https://rustsec.org/advisories/RUSTSEC-2026-0176.html](https://rustsec.org/advisories/RUSTSEC-2026-0176.html)
-
[https://github.com/advisories/GHSA-36hh-v3qg-5jq4](https://redirect.github.com/advisories/GHSA-36hh-v3qg-5jq4)
This data is provided by the [GitHub Advisory
Database](https://redirect.github.com/advisories/GHSA-36hh-v3qg-5jq4)
([CC-BY
4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>
---
### PyO3 has a missing `Sync` bound on `PyCFunction::new_closure`
closures
[GHSA-chgr-c6px-7xpp](https://redirect.github.com/advisories/GHSA-chgr-c6px-7xpp)
<details>
<summary>More information</summary>
#### Details
`PyCFunction::new_closure` (and the temporary `new_closure_bound`
complement in the 0.21–0.22 series) required the supplied closure to be
`Send + 'static` but not `Sync`. The resulting `PyCFunction` is a Python
callable that can be invoked from any Python thread, which means the
closure may be called concurrently from multiple threads, and needs a
`Sync` bound to prevent possible data races.
The problem exists under all Python versions but is particularly
vulnerable under the newer free-threaded Python variant, which do not
have serial execution imposed by the Global Interpreter Lock. Under
releases protected by the GIL, the ability to "detach" from the Python
interpreter temporarily inside the closure (e.g. by `Python::detach`)
makes it possible for interleaved and/or concurrent execution of various
portions of the closure.
PyO3 0.29.0 added a `Sync` bound to close this thread-safety bug.
#### Severity
- CVSS Score: 6.3 / 10 (Medium)
- Vector String:
`CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N`
#### References
-
[https://github.com/PyO3/pyo3/pull/6096](https://redirect.github.com/PyO3/pyo3/pull/6096)
-
[https://github.com/PyO3/pyo3/releases/tag/v0.29.0](https://redirect.github.com/PyO3/pyo3/releases/tag/v0.29.0)
-
[https://rustsec.org/advisories/RUSTSEC-2026-0177.html](https://rustsec.org/advisories/RUSTSEC-2026-0177.html)
-
[https://github.com/advisories/GHSA-chgr-c6px-7xpp](https://redirect.github.com/advisories/GHSA-chgr-c6px-7xpp)
This data is provided by the [GitHub Advisory
Database](https://redirect.github.com/advisories/GHSA-chgr-c6px-7xpp)
([CC-BY
4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>
---
### Release Notes
<details>
<summary>pyo3/pyo3 (pyo3)</summary>
###
[`v0.29.0`](https://redirect.github.com/pyo3/pyo3/blob/HEAD/CHANGELOG.md#0290---2026-06-11)
[Compare
Source](https://redirect.github.com/pyo3/pyo3/compare/v0.28.3...v0.29.0)
##### Packaging
- Support the new PEP 803 abi3t ABI with new `abi3t` and `abi3t-py315`
features.
[#​5807](https://redirect.github.com/PyO3/pyo3/pull/5807)
- `pyo3-macros-backend` no longer depends on `pyo3-build-config`.
[#​5809](https://redirect.github.com/PyO3/pyo3/pull/5809)
- Drop support for Python 3.13t (3.14t and above continue to be
supported; CPython declared free-threading supported starting with
Python 3.14).
[#​5865](https://redirect.github.com/PyO3/pyo3/pull/5865)
- Drop support for Python 3.7.
[#​5912](https://redirect.github.com/PyO3/pyo3/pull/5912)
- Extend range of supported versions of `hashbrown` optional dependency
to include version 0.17.
[#​5973](https://redirect.github.com/PyO3/pyo3/pull/5973)
- Support Python 3.15.0b1.
[#​6014](https://redirect.github.com/PyO3/pyo3/pull/6014)
- `pyo3-ffi` is now `no_std`.
[#​6022](https://redirect.github.com/PyO3/pyo3/pull/6022)
##### Added
- Add `PyErr::set_traceback` to set the traceback of an exception
object. [#​5349](https://redirect.github.com/PyO3/pyo3/pull/5349)
- Add `PyUnicodeDecodeError::new_err_from_utf8` to create a `PyErr` from
a `str::Utf8Error`.
[#​5668](https://redirect.github.com/PyO3/pyo3/pull/5668)
- `experimental-inspect`: implement `INPUT_TYPE` and `OUTPUT_TYPE` on
optional third-party crate conversions.
[#​5770](https://redirect.github.com/PyO3/pyo3/pull/5770)
- `experimental-inspect`: include doc comments in generated stubs.
[#​5782](https://redirect.github.com/PyO3/pyo3/pull/5782)
- Add `pyo3_build_config::PythonAbi`,
`pyo3_build_config::PythonAbiKind`,
`pyo3_build_config::PythonAbiBuilder`,
`pyo3_build_config::InterpreterConfig::target_abi`, and
`pyo3_build_config::InterpreterConfigBuilder::target_abi`.
[#​5807](https://redirect.github.com/PyO3/pyo3/pull/5807)
- Add `Borrowed::get` as an equivalent to `Bound::get` and `Py::get`.
[#​5849](https://redirect.github.com/PyO3/pyo3/pull/5849)
- Add `PyFrame::new`, `PyTraceBack::new`, and
`PyFrameMethods::line_number`.
[#​5857](https://redirect.github.com/PyO3/pyo3/pull/5857)
- Add `PyUntypedBuffer::obj` to retrieve the Python object owning the
buffer. [#​5870](https://redirect.github.com/PyO3/pyo3/pull/5870)
- Add `PyCapsule::new_with_value` and
`PyCapsule::new_with_value_and_destructor`.
[#​5881](https://redirect.github.com/PyO3/pyo3/pull/5881)
- Add `PyErr::set_context` and `PyErr::context`.
[#​5887](https://redirect.github.com/PyO3/pyo3/pull/5887)
- Add a small CLI to `pyo3-introspection` to generate stubs.
[#​5904](https://redirect.github.com/PyO3/pyo3/pull/5904)
- Add `Python::version_str`.
[#​5921](https://redirect.github.com/PyO3/pyo3/pull/5921)
- Add `TryFrom<&Bound<T>>` for `PyRef<T>`, `PyRefMut<T>`,
`PyClassGuard<T>` and `PyClassGuardMut<T>`.
[#​5922](https://redirect.github.com/PyO3/pyo3/pull/5922)
- Add `From<&Bound<T>>` for `Bound<T>` and `Py<T>`
[#​5922](https://redirect.github.com/PyO3/pyo3/pull/5922)
- Add `PyDictMethods::set_default` and `PyDictMethods::set_default_ref`
to allow atomically setting default values in a PyDict.
[#​5955](https://redirect.github.com/PyO3/pyo3/pull/5955)
- add `PyFrameMethods::outer|code|var|builtins|globals|locals`.
[#​5967](https://redirect.github.com/PyO3/pyo3/pull/5967)
- Add `From` conversions for `PyErr` from
`std::time::TryFromFloatSecsError`, `std::time::SystemTimeError`,
`std::path::StripPrefixError`, `std::env::JoinPathsError`,
`std::char::ParseCharError`, and `std::char::CharTryFromError`.
[#​6001](https://redirect.github.com/PyO3/pyo3/pull/6001)
- Add `pyo3_build_config::InterpreterConfigBuilder`.
[#​6034](https://redirect.github.com/PyO3/pyo3/pull/6034)
- Add `PyCapsule::import_pointer`
[#​6066](https://redirect.github.com/PyO3/pyo3/pull/6066)
- Add `PyClassGuardMapMut`.
[#​6073](https://redirect.github.com/PyO3/pyo3/pull/6073)
- Expose `PyListMethods::get_item_unchecked`,
`PyTupleMethods::get_item_unchecked`, and
`PyTupleMethods::get_borrowed_item_unchecked` on abi3.
[#​6075](https://redirect.github.com/PyO3/pyo3/pull/6075)
- Add `PyClassGuardMapSuper`.
[#​6104](https://redirect.github.com/PyO3/pyo3/pull/6104)
- Add `PyClassGuard` and `PyClassGuardMut` to `pyo3::prelude`.
[#​6112](https://redirect.github.com/PyO3/pyo3/pull/6112)
- Add `Debug` impls for `PyClassGuard` and `PyClassGuardMut`.
[#​6112](https://redirect.github.com/PyO3/pyo3/pull/6112)
- Enable extending `PyDateTime`, `PyDate`, `PyTime`, `PyDelta` and
`PyTzInfo` on abi3 with python 3.12+.
[#​6115](https://redirect.github.com/PyO3/pyo3/pull/6115)
- Expose `PyFunction` available on abi3.
[#​6117](https://redirect.github.com/PyO3/pyo3/pull/6117)
- FFI definitions:
- Added FFI definitions `PyUnstable_Object_IsUniquelyReferenced`,
`PyUnstable_Object_IsUniquelyReferencedTemporary`,
`PyUnstable_EnableTryIncref`, and `PyUnstable_TryIncref`.
[#​5828](https://redirect.github.com/PyO3/pyo3/pull/5828)
- Add FFI definitions `ffi::PyErr_GetHandledException` and
`ffi::PyErr_SetHandledException`.
[#​5887](https://redirect.github.com/PyO3/pyo3/pull/5887)
- Add FFI definition `Py_HASH_SIPHASH13`.
[#​5891](https://redirect.github.com/PyO3/pyo3/pull/5891)
- Add FFI definition `PyStructSequence_UnnamedField` constant on Python
3.9 and up (or 3.11 with abi3 features).
[#​5892](https://redirect.github.com/PyO3/pyo3/pull/5892)
- Add FFI definitions `PyUnstable_InterpreterFrame_GetCode`,
`PyUnstable_InterpreterFrame_GetLasti`,
`PyUnstable_InterpreterFrame_GetLine`, and `PyUnstable_ExecutableKinds`.
[#​5932](https://redirect.github.com/PyO3/pyo3/pull/5932)
- Add FFI definitions `PyMarshal_WriteLongToFile`,
`PyMarshal_WriteObjectToFile`, `PyMarshal_ReadLongFromFile`,
`PyMarshal_ReadShortFromFile`, `PyMarshal_ReadObjectFromFile`, and
`PyMarshal_ReadLastObjectFromFile`.
[#​5934](https://redirect.github.com/PyO3/pyo3/pull/5934)
- Add FFI definitions `PyObject_GetAIter`, `PyAIter_Check`,
`PyMapping_HasKeyWithError`, `PyMapping_HasKeyStringWithError`,
`PyMapping_GetOptionalItem`, `PyMapping_GetOptionalItemString`,
`PySequence_ITEM`, `PySequence_Fast_GET_SIZE`,
`PySequence_Fast_GET_ITEM`, and `PySequence_Fast_ITEMS`.
[#​5942](https://redirect.github.com/PyO3/pyo3/pull/5942)
- Add FFI definition `compat::PyObject_HasAttrWithError`.
[#​5944](https://redirect.github.com/PyO3/pyo3/pull/5944)
- Add FFI definitions `PyDict_SetDefault`, `PyDict_SetDefaultRef`,
`PyDict_ContainsString`, `PyDict_Pop`, `PyDict_PopString`,
`PyDict_ClearWatcher`, `PyDict_Watch`, `PyDict_Unwatch`, and
`PyFrozenDict_New`.
[#​5947](https://redirect.github.com/PyO3/pyo3/pull/5947)
- Add FFI definitions `PyDate_FromDate`, `PyDateTime_FromDateAndTime`,
`PyDateTime_FromDateAndTimeAndFold`, `PyTime_FromTime`,
`PyTime_FromTimeAndFold`, and `PyDelta_FromDSU`.
[#​5949](https://redirect.github.com/PyO3/pyo3/pull/5949)
- Add FFI definitions `PyDict_SetDefaultRef` and
`compat::PyDict_SetDefaultRef`.
[#​5955](https://redirect.github.com/PyO3/pyo3/pull/5955)
versions.
- Add FFI definitions for non-limited API header
`cpython/bytearrayobject.h`.
[#​5966](https://redirect.github.com/PyO3/pyo3/pull/5966)
- Add FFI definitions for non-limited API version of `PyCellObject` and
associated functions.
[#​5978](https://redirect.github.com/PyO3/pyo3/pull/5978)
- Add FFI definition `PyErr_WarnExplicitObject`.
[#​5979](https://redirect.github.com/PyO3/pyo3/pull/5979)
- Add FFI definition `PyTracebackObject`.
[#​5980](https://redirect.github.com/PyO3/pyo3/pull/5980)
- Add FFI definition `PyTuple_FromArray` on 3.15+.
[#​5990](https://redirect.github.com/PyO3/pyo3/pull/5990)
- Add FFI definitions for the PEP 820 PySlot C API.
[#​6014](https://redirect.github.com/PyO3/pyo3/pull/6014)
- Add FFI definitions for the critical section API in the limited API on
Python 3.15
and newer.
[#​6014](https://redirect.github.com/PyO3/pyo3/pull/6014)
- Add FFI definitions for [PEP 757](https://peps.python.org/pep-0757/)
`PyLong` import / export API on Python 3.14+.
[#​6016](https://redirect.github.com/PyO3/pyo3/pull/6016)
- Add FFI definitions `PyEval_SetProfileAllThreads` and
`PyEval_SetTraceAllThreads`.
[#​6038](https://redirect.github.com/PyO3/pyo3/pull/6038)
- Add FFI definition `Py_UNICODE_TODECIMAL`.
[#​6041](https://redirect.github.com/PyO3/pyo3/pull/6041)
##### Changed
- Change exception enrichment on `#[pyfunction]` argument extraction
error to use `PyErr::add_note` instead of replacing `TypeError`
instances.
[#​5349](https://redirect.github.com/PyO3/pyo3/pull/5349)
- Deprecate super-class initialization via tuples.
[#​5741](https://redirect.github.com/PyO3/pyo3/pull/5741)
- Change module initialization uses the PyModExport and PyABIInfo APIs
on Python 3.15+.
[#​5753](https://redirect.github.com/PyO3/pyo3/pull/5753)
- Deprecate `Py<T>::get_refcnt` and `PyAnyMethods::get_refcnt` in favor
of `pyo3::ffi::Py_REFCNT(obj.as_ptr())`.
[#​5797](https://redirect.github.com/PyO3/pyo3/pull/5797)
- Change `PyEnvironmentError`, `PyIOError`, and `PyWindowsError` to be
type aliases of `PyOSError` (as is the case in Python since 3.3).
[#​5803](https://redirect.github.com/PyO3/pyo3/pull/5803)
- Change `pyo3_build_config::InterpreterConfig::from_interpreter` to
require an additional `stable_abi_version` argument. The old behavior is
the same as passing `None`.
[#​5807](https://redirect.github.com/PyO3/pyo3/pull/5807)
- Change `PyList::new` to no longer have `ExactSizeIterator` bound.
[#​5830](https://redirect.github.com/PyO3/pyo3/pull/5830)
- `experimental-inspect`: emit `#[classattribute]` as plain Python class
attributes and not functions annotated with `@classattribute` and
`@property`.
[#​5839](https://redirect.github.com/PyO3/pyo3/pull/5839)
- `experimental-inspect`: use `object` as the input annotation type of
magic methods that return `NonImplemented` if the input value is not of
the correct type.
[#​5841](https://redirect.github.com/PyO3/pyo3/pull/5841)
- Deprecate `pyo3-build-config/resolve-config` feature.
[#​5862](https://redirect.github.com/PyO3/pyo3/pull/5862)
- Change `pyo3-ffi` to use raw-dylib for Windows linking.
[#​5866](https://redirect.github.com/PyO3/pyo3/pull/5866)
- Deprecate `generate-import-lib` feature.
[#​5866](https://redirect.github.com/PyO3/pyo3/pull/5866)
- Allow zero-sized types in `PyCapsule::new`.
[#​5889](https://redirect.github.com/PyO3/pyo3/pull/5889)
- `PyDate::from_timestamp` argument is now a `f64` (the Python API
expects a float and not an integer)
[#​5896](https://redirect.github.com/PyO3/pyo3/pull/5896)
- `experimental-inspect`: Change `PathBuf::extract` input type hint from
`str | os.PathLike` to `str | os.PathLike[str]`
[#​5897](https://redirect.github.com/PyO3/pyo3/pull/5897)
- Remove lifetime from `PythonVersionInfo`.
[#​5921](https://redirect.github.com/PyO3/pyo3/pull/5921)
- Remove redundant type checks for methods where CPython guarantees the
type of `self`.
[#​5930](https://redirect.github.com/PyO3/pyo3/pull/5930)
- Elide temporary reference count cycles inside `PyAnyMethods::call`,
`PyAnyMethods::call1` and `PyAnyMethods::call_method1` for arguments
passed as Rust tuples containing borrowed references to Python objects.
[#​5941](https://redirect.github.com/PyO3/pyo3/pull/5941)
- Allow type annotations to be used in `#[pyo3(signature = ...)]` when
`experimental-inspect` feature is not enabled (they will be ignored).
[#​5999](https://redirect.github.com/PyO3/pyo3/pull/5999)
- `pyo3-ffi` will now rebuild when the Python virtual environment
changes in-place.
[#​6008](https://redirect.github.com/PyO3/pyo3/pull/6008)
- Change module initialization on 3.15+ to use PEP 820 PySlot API
internally.
[#​6014](https://redirect.github.com/PyO3/pyo3/pull/6014)
- Deprecate direct access to all `pyo3_build_config::InterpreterConfig`
fields; getter methods have been added as replacements.
[#​6034](https://redirect.github.com/PyO3/pyo3/pull/6034)
- FFI definitions `_PyCode_GetExtra`, `_PyCode_SetExtra`, and
`_PyEval_RequestCodeExtraIndex` have been updated to
`PyUnstable_Code_GetExtra`, `PyUnstable_Code_SetExtra`, and
`PyUnstable_Eval_RequestCodeExtraIndex`.
[#​6038](https://redirect.github.com/PyO3/pyo3/pull/6038)
- Change `PyCapsule::import` to return an error if the pointer is not
properly aligned.
[#​6066](https://redirect.github.com/PyO3/pyo3/pull/6066)
- Change `PyClassGuardMap` to be only for `PyClassGuard::map` and return
`PyClassGuardMapMut` from `PyClassGuardMut::map`.
[#​6073](https://redirect.github.com/PyO3/pyo3/pull/6073)
- Change `with_critical_section_mutex2` closure to take
`Option<EnteredCriticalSection>` instead of `EnteredCriticalSection` as
the second argument.
[#​6098](https://redirect.github.com/PyO3/pyo3/pull/6098)
- `PyClassGuardMut::as_super` now returns `PyClassGuardMutSuper`.
[#​6104](https://redirect.github.com/PyO3/pyo3/pull/6104)
- `experimental-inspect`: Generate relative imports instead of absolute
ones (useful if the stubs are not describing a root package)
[#​6097](https://redirect.github.com/PyO3/pyo3/pull/6097)
##### Removed
- Removed the broken (and unfixable) implementations of
`From<str::Utf8Error>`, `From<string::FromUtf16Error>`, and
`From<char::DecodeUtf16Error>` for `PyErr`.
[#​5668](https://redirect.github.com/PyO3/pyo3/pull/5668)
- Remove `Py_TRACE_REFS` support (unsupported from Python 3.13).
[#​5824](https://redirect.github.com/PyO3/pyo3/pull/5824)
- `experimental-inspect`: Remove the `TypeInfo` enum and the
`FromPyObject::type_input` and `IntoPyObject::type_output` functions.
They are replaced by the `PyStaticExpr` enum and the
`FromPyObject::INPUT_TYPE` and the `IntoPyObject::OUTPUT_TYPE`
associated constants.
[#​5893](https://redirect.github.com/PyO3/pyo3/pull/5893)
- Remove all functionality deprecated in PyO3 0.27.
[#​6068](https://redirect.github.com/PyO3/pyo3/pull/6068)
- FFI definitions:
- Remove private FFI definitions `_PyStack_AsDict`,
`_PyObject_CallNoArg`, `_PyObject_FastCall`, `_PyObject_FastCallTstate`.
`_PyObject_VectorcallTstate`, `_PyObject_MakeTpCall`,
`_Py_CheckFunctionResult`, `_PyObject_CallFunction_SizeT`,
`_PyObject_CallMethod_SizeT`, and `_PySequence_IterSearch`.
[#​5942](https://redirect.github.com/PyO3/pyo3/pull/5942)
- Remove FFI definitions `PY_ITERSEARCH_COUNT`, `PY_ITERSEARCH_INDEX`,
and `PY_ITERSEARCH_CONTAINS`.
[#​5942](https://redirect.github.com/PyO3/pyo3/pull/5942)
- Removed private FFI definitions `_PySet_NextEntry`, and
`_PyLong_NumBits`.
[#​5946](https://redirect.github.com/PyO3/pyo3/pull/5946)
- Remove private FFI definitions `_PyFloat_CAST`,
`_PyRun_SimpleFileObject`, `_PyRun_AnyFileObject`,
`_PyRun_InteractiveLoopObject`, `_PyUnicode_CheckConsistency`,
`_PyUnicode_COMPACT_DATA`, `_PyUnicode_NONCOMPACT_DATA`,
`_PyUnicode_Ready`, and `_Py_HashBytes`.
[#​6036](https://redirect.github.com/PyO3/pyo3/pull/6036)
- Remove private FFI definition `_PyEval_EvalFrameDefault`.
[#​6038](https://redirect.github.com/PyO3/pyo3/pull/6038)
- Remove private FFI definition `_PyBytes_Resize`.
[#​6042](https://redirect.github.com/PyO3/pyo3/pull/6042)
- Remove private FFI definitions `_PyErr_BadInternalCall`,
`_Py_GetAllocatedBlocks`, `_PyObject_GC_Malloc`, `_PyObject_GC_Calloc`,
and `_PyLong_NumBits`.
[#​6053](https://redirect.github.com/PyO3/pyo3/pull/6053)
- Remove `Default` for FFI definitions `PyHeapTypeObject`,
`PyObjectArenaAllocator`, `PyHash_FuncDef`, and `PyType_Spec`.
[#​6093](https://redirect.github.com/PyO3/pyo3/pull/6093)
##### Fixed
- Fix `add_libpython_rpath_link_args` emitting rpath link args on wasm
targets which don't support rpath.
[#​5447](https://redirect.github.com/PyO3/pyo3/pull/5447)
- Fix `From<string::FromUtf8Error>` and `From<ffi::IntoStringError>` for
`PyErr` producing `TypeError` due to broken internals.
[#​5668](https://redirect.github.com/PyO3/pyo3/pull/5668)
- Fix `PyMappingProxy::is_type_of` and `PyWeakrefReference::is_type_of`
not accepting subclasses.
[#​5883](https://redirect.github.com/PyO3/pyo3/pull/5883)
- Fix `getattr_opt` not treating `AttributeError` subclasses as missing
attributes on Python < 3.13.
[#​5985](https://redirect.github.com/PyO3/pyo3/pull/5985)
- Fix compilation error for `#[new]` return types that contain named
lifetimes.
[#​5998](https://redirect.github.com/PyO3/pyo3/pull/5998)
- Fix missing `'static` bound on `PyCapsule` destructors.
[#​6049](https://redirect.github.com/PyO3/pyo3/pull/6049)
- Fix case where `PyFrame::builtins` could return a non-dict object.
[#​6052](https://redirect.github.com/PyO3/pyo3/pull/6052)
- Fix type confusion when returning a `#[pyclass]` from a different
pyclass' `#[new]` method.
[#​6062](https://redirect.github.com/PyO3/pyo3/pull/6062)
- Fix soundness issue caused by variance in `PyClassGuardMap` by
splitting off the mutable variant.
[#​6073](https://redirect.github.com/PyO3/pyo3/pull/6073)
- Fix nondeterministic JSON metadata emitted by the
`experimental-inspect` proc macros (to enable reproducible builds).
[#​6076](https://redirect.github.com/PyO3/pyo3/pull/6076)
- Fix UB in `PyEval_RestoreThread` when the interpreter is shutting down
on Python 3.13 and older (hang the thread instead of allowing
`pthread_exit` to jump across Rust frames).
[#​6085](https://redirect.github.com/PyO3/pyo3/pull/6085)
- Fix possible out of bounds read in `BoundListIterator` and
`BoundTupleIterator`'s `nth` and `nth_back` implementations.
[#​6086](https://redirect.github.com/PyO3/pyo3/pull/6086)
- Fix `BoundListIterator` and `BoundTupleIterator` not being exhausted
when `nth` or `nth_back` is called with N larger than the remaining
count of items.
[#​6086](https://redirect.github.com/PyO3/pyo3/pull/6086)
- Fix missing `Sync` bound on closure type in
`PyCFunction::new_closure`.
[#​6096](https://redirect.github.com/PyO3/pyo3/pull/6096)
- Fix soundness issue caused by exposing a mutable reference from
`PyClassGuardMut::as_super` by moving into `PyClassGuardMutSuper`.
[#​6104](https://redirect.github.com/PyO3/pyo3/pull/6104)
- FFI definitions:
- Fix missing FFI definition for `PyTypeObject.tp_versions_used` on
Python 3.13 and newer.
[#​5917](https://redirect.github.com/PyO3/pyo3/pull/5917)
- Mark FFI definitions no longer available on 3.11 and up:
`PyUnicode_Encode`, `PyUnicode_EncodeASCII`, `PyUnicode_EncodeCharmap`,
`PyUnicode_EncodeDecimal`, `PyUnicode_EncodeLatin1`,
`PyUnicode_EncodeRawUnicodeEscape`, `PyUnicode_EncodeUTF7`,
`PyUnicode_EncodeUTF8`, `PyUnicode_EncodeUTF16`,
`PyUnicode_EncodeUTF32`, `PyUnicode_EncodeUnicodeEscape`,
`PyUnicode_TransformDecimalToASCII`, and `PyUnicode_TranslateCharmap`.
[#​6041](https://redirect.github.com/PyO3/pyo3/pull/6041)
- Mark FFI definition `PyUnicode_ClearFreeList` no longer available on
3.9 and up.
[#​6041](https://redirect.github.com/PyO3/pyo3/pull/6041)
- Fix FFI definition `PyErr_SetInterruptEx` missing `c_int` return type.
[#​6043](https://redirect.github.com/PyO3/pyo3/pull/6043)
- Fix return type of FFI definition `PyBuffer_SizeFromFormat` on Python
3.8 (was changed from `c_int` to `Py_ssize_t` on Python 3.9).
[#​6090](https://redirect.github.com/PyO3/pyo3/pull/6090)
- Fix return type of FFI definition `PyUnicode_Tailmatch` on PyPy (is
`c_int`, unlike CPython).
[#​6090](https://redirect.github.com/PyO3/pyo3/pull/6090)
###
[`v0.28.3`](https://redirect.github.com/pyo3/pyo3/blob/HEAD/CHANGELOG.md#0283---2026-04-02)
[Compare
Source](https://redirect.github.com/pyo3/pyo3/compare/v0.28.2...v0.28.3)
##### Fixed
- Fix compile error with `#[pyclass(get_all)]` on a type named `Probe`.
[#​5837](https://redirect.github.com/PyO3/pyo3/pull/5837)
- Fix compile error in debug builds related to `_Py_NegativeRefcount`
with Python < 3.12.
[#​5847](https://redirect.github.com/PyO3/pyo3/pull/5847)
- Fix a race condition where `Python::attach` or `try_attach` could
return before `site.py` had finished running.
[#​5903](https://redirect.github.com/PyO3/pyo3/pull/5903)
- Fix unsoundness in `PyBytesWriter::write_vectored` with Python 3.15
prerelease versions.
[#​5907](https://redirect.github.com/PyO3/pyo3/pull/5907)
- Fix deadlock in `.into_pyobject()` implementation for C-like
`#[pyclass]` enums.
[#​5928](https://redirect.github.com/PyO3/pyo3/pull/5928)
###
[`v0.28.2`](https://redirect.github.com/pyo3/pyo3/blob/HEAD/CHANGELOG.md#0282---2026-02-18)
[Compare
Source](https://redirect.github.com/pyo3/pyo3/compare/v0.28.1...v0.28.2)
##### Fixed
- Fix complex enum `__qualname__` not using python name
[#​5815](https://redirect.github.com/PyO3/pyo3/pull/5815)
- Fix FFI definition `PyType_GetTypeDataSize` (was incorrectly named
`PyObject_GetTypeDataSize`).
[#​5819](https://redirect.github.com/PyO3/pyo3/pull/5819)
- Fix memory corruption when subclassing native types with `abi3`
feature on Python 3.12+ (newly enabled in PyO3 0.28.0).
[#​5823](https://redirect.github.com/PyO3/pyo3/pull/5823)
###
[`v0.28.1`](https://redirect.github.com/pyo3/pyo3/blob/HEAD/CHANGELOG.md#0281---2026-02-14)
[Compare
Source](https://redirect.github.com/pyo3/pyo3/compare/v0.28.0...v0.28.1)
##### Fixed
- Fix `*args` / `**kwargs` support in` experimental-async` feature
(regressed in 0.28.0).
[#​5771](https://redirect.github.com/PyO3/pyo3/pull/5771)
- Fix `clippy::declare_interior_mutable_const` warning inside
`#[pyclass]` generated code on enums.
[#​5772](https://redirect.github.com/PyO3/pyo3/pull/5772)
- Fix `ambiguous_associated_items` compilation error when deriving
`FromPyObject` or using `#[pyclass(from_py_object)]` macro on enums with
`Error` variant.
[#​5784](https://redirect.github.com/PyO3/pyo3/pull/5784)
- Fix `__qualname__` for complex `#[pyclass]` enum variants to include
the enum name.
[#​5796](https://redirect.github.com/PyO3/pyo3/pull/5796)
- Fix missing `std::sync::atomic::Ordering` import for targets without
atomic64.
[#​5808](https://redirect.github.com/PyO3/pyo3/pull/5808)
###
[`v0.28.0`](https://redirect.github.com/pyo3/pyo3/blob/HEAD/CHANGELOG.md#0280---2026-02-01)
[Compare
Source](https://redirect.github.com/pyo3/pyo3/compare/v0.27.2...v0.28.0)
##### Packaging
- Bump MSRV to Rust 1.83.
[#​5531](https://redirect.github.com/PyO3/pyo3/pull/5531)
- Bump minimum supported `quote` version to 1.0.37.
[#​5531](https://redirect.github.com/PyO3/pyo3/pull/5531)
- Bump supported GraalPy version to 25.0.
[#​5542](https://redirect.github.com/PyO3/pyo3/pull/5542)
- Drop `memoffset` dependency.
[#​5545](https://redirect.github.com/PyO3/pyo3/pull/5545)
- Support for free-threaded Python is now opt-out rather than opt-in.
[#​5564](https://redirect.github.com/PyO3/pyo3/pull/5564)
- Bump `target-lexicon` dependency to 0.13.3.
[#​5571](https://redirect.github.com/PyO3/pyo3/pull/5571)
- Drop `indoc` and `unindent` dependencies.
[#​5608](https://redirect.github.com/PyO3/pyo3/pull/5608)
##### Added
- Add `__init__` support in `#[pymethods]`.
[#​4951](https://redirect.github.com/PyO3/pyo3/pull/4951)
- Expose `PySuper` on PyPy, GraalPy and ABI3
[#​4951](https://redirect.github.com/PyO3/pyo3/pull/4951)
- Add `PyString::from_fmt` and `py_format!` macro.
[#​5199](https://redirect.github.com/PyO3/pyo3/pull/5199)
- Add `#[pyclass(new = "from_fields")]` option.
[#​5421](https://redirect.github.com/PyO3/pyo3/pull/5421)
- Add `pyo3::buffer::PyUntypedBuffer`, a type-erased form of
`PyBuffer<T>`.
[#​5458](https://redirect.github.com/PyO3/pyo3/pull/5458)
- Add `PyBytes::new_with_writer`
[#​5517](https://redirect.github.com/PyO3/pyo3/pull/5517)
- Add `PyClass::NAME`.
[#​5579](https://redirect.github.com/PyO3/pyo3/pull/5579)
- Add `pyo3_build_config::add_libpython_rpath_link_args`.
[#​5624](https://redirect.github.com/PyO3/pyo3/pull/5624)
- Add `PyBackedStr::clone_ref` and `PyBackedBytes::clone_ref` methods.
[#​5654](https://redirect.github.com/PyO3/pyo3/pull/5654)
- Add `PyCapsule::new_with_pointer` and
`PyCapsule::new_with_pointer_and_destructor` for creating capsules with
raw pointers.
[#​5689](https://redirect.github.com/PyO3/pyo3/pull/5689)
- Add `#[deleter]` attribute to implement property deleters in
`#[methods]`.
[#​5699](https://redirect.github.com/PyO3/pyo3/pull/5699)
- Add `IntoPyObject` and `FromPyObject` implementations for
`uuid::NonNilUuid`.
[#​5707](https://redirect.github.com/PyO3/pyo3/pull/5707)
- Add `PyBackedStr::as_str` and `PyBackedStr::as_py_str` methods.
[#​5723](https://redirect.github.com/PyO3/pyo3/pull/5723)
- Add support for subclassing native types (`PyDict`, exceptions, ...)
when building for abi3 on Python 3.12+.
[#​5733](https://redirect.github.com/PyO3/pyo3/pull/5733)
- Add support for subclassing `PyList` when building for Python 3.12+.
[#​5734](https://redirect.github.com/PyO3/pyo3/pull/5734)
- FFI definitions:
- Add FFI definitions `PyEval_GetFrameBuiltins`,
`PyEval_GetFrameGlobals` and `PyEval_GetFrameLocals` on Python 3.13 and
up. [#​5590](https://redirect.github.com/PyO3/pyo3/pull/5590)
- Add FFI definitions `PyObject_New`, `PyObject_NewVar`,
`PyObject_GC_Resize`, `PyObject_GC_New`, and `PyObject_GC_NewVar`.
[#​5591](https://redirect.github.com/PyO3/pyo3/pull/5591)
- Added FFI definitions and an unsafe Rust API wrapping
`Py_BEGIN_CRITICAL_SECTION_MUTEX` and
`Py_BEGIN_CRITICAL_SECTION_MUTEX2`.
[#​5642](https://redirect.github.com/PyO3/pyo3/pull/5642)
- Add FFI definition `PyDict_GetItemStringRef` on Python 3.13 and up.
[#​5659](https://redirect.github.com/PyO3/pyo3/pull/5659)
- Add FFI definition `PyIter_NextItem` on Python 3.14 and up, and
`compat::PyIter_NextItem` for older versions.
[#​5661](https://redirect.github.com/PyO3/pyo3/pull/5661)
- Add FFI definitions `PyThreadState_GetInterpreter` and
`PyThreadState_GetID` on Python 3.9+, `PyThreadState_EnterTracing` and
`PyThreadState_LeaveTracing` on Python 3.11+,
`PyThreadState_GetUnchecked` on Python 3.13+, and
`compat::PyThreadState_GetUnchecked`.
[#​5711](https://redirect.github.com/PyO3/pyo3/pull/5711)
- Add FFI definitions `PyImport_ImportModuleAttr` and
`PyImport_ImportModuleAttrString` on Python 3.14+.
[#​5737](https://redirect.github.com/PyO3/pyo3/pull/5737)
- Add FFI definitions for the `PyABIInfo` and `PyModExport` APIs
available in Python 3.15.
[#​5746](https://redirect.github.com/PyO3/pyo3/pull/5746)
- `experimental-inspect`:
- Emit base classes.
[#​5331](https://redirect.github.com/PyO3/pyo3/pull/5331)
- Emit `@typing.final` on final classes.
[#​5552](https://redirect.github.com/PyO3/pyo3/pull/5552)
- Generate nested classes for complex enums.
[#​5708](https://redirect.github.com/PyO3/pyo3/pull/5708)
- Emit `async` keyword for async functions.
[#​5731](https://redirect.github.com/PyO3/pyo3/pull/5731)
##### Changed
- Call `sys.unraisablehook` instead of `PyErr_Print` if panicking on
null FFI pointer in `Bound`, `Borrowed` and `Py` constructors.
[#​5496](https://redirect.github.com/PyO3/pyo3/pull/5496)
- Use PEP-489 multi-phase initialization for `#[pymodule]`.
[#​5525](https://redirect.github.com/PyO3/pyo3/pull/5525)
- Deprecate implicit by-value implementation of `FromPyObject` for
`#[pyclass]`.
[#​5550](https://redirect.github.com/PyO3/pyo3/pull/5550)
- Deprecate `PyTypeInfo::NAME` and `PyTypeInfo::MODULE`.
[#​5579](https://redirect.github.com/PyO3/pyo3/pull/5579)
- Deprecate `Py<T>::from_{owned,borrowed}[or_{err,opt}]` constructors
from raw pointer.
[#​5585](https://redirect.github.com/PyO3/pyo3/pull/5585)
- Deprecate FFI definitions `PyEval_AcquireLock` and
`PyEval_ReleaseLock`.
[#​5590](https://redirect.github.com/PyO3/pyo3/pull/5590)
- Relax `'py: 'a` bound in `Py::extract`.
[#​5594](https://redirect.github.com/PyO3/pyo3/pull/5594)
- Add a `T: PyTypeCheck` bound to the `IntoPyObject` implementations on
`Bound<T>`, `Borrowed<T>` and `Py<T>`.
[#​5640](https://redirect.github.com/PyO3/pyo3/pull/5640)
- The `with_critical_section` and `with_critical_section2` functions are
moved to `pyo3::sync::critical_section`.
[#​5642](https://redirect.github.com/PyO3/pyo3/pull/5642)
- Use `PyIter_NextItem` in `PyIterator::next` implementation.
[#​5661](https://redirect.github.com/PyO3/pyo3/pull/5661)
- `IntoPyObject` for simple enums now uses a singleton value, allowing
identity (python `is`) comparisons.
[#​5665](https://redirect.github.com/PyO3/pyo3/pull/5665)
- Allow any `Sequence[int]` in `FromPyObject` on `Cow<[u8]>` and change
the error type to `PyErr`.
[#​5667](https://redirect.github.com/PyO3/pyo3/pull/5667)
- `async` pymethods now borrow `self` only for the duration of awaiting
the future, not the entire method call.
[#​5684](https://redirect.github.com/PyO3/pyo3/pull/5684)
- Change `CastError` formatted message to directly describe the "is not
an instance of" failure condition.
[#​5693](https://redirect.github.com/PyO3/pyo3/pull/5693)
- Add `#[inline]` hints to many methods on `PyBackedStr`.
[#​5723](https://redirect.github.com/PyO3/pyo3/pull/5723)
- Remove redundant internal counters from `BoundSetIterator` and
`BoundFrozenSetIterator`.
[#​5725](https://redirect.github.com/PyO3/pyo3/pull/5725)
- Implement `PyIterator::size_hint` on abi3 builds (previously was only
on unlimited API builds).
[#​5727](https://redirect.github.com/PyO3/pyo3/pull/5727)
- Deprecate FFI definition `PyImport_ImportModuleNoBlock` (deprecated in
Python 3.13).
[#​5737](https://redirect.github.com/PyO3/pyo3/pull/5737)
- `#[new]` can now return arbitrary Python objects.
[#​5739](https://redirect.github.com/PyO3/pyo3/pull/5739)
- `experimental-inspect`:
- Introduce `TypeHint` and make use of it to encode type hint
annotations.
[#​5438](https://redirect.github.com/PyO3/pyo3/pull/5438)
- Rename `PyType{Info,Check}::TYPE_INFO` into
`PyType{Info,Check}::TYPE_HINT`.
[#​5438](https://redirect.github.com/PyO3/pyo3/pull/5438)
[#​5619](https://redirect.github.com/PyO3/pyo3/pull/5619)
[#​5641](https://redirect.github.com/PyO3/pyo3/pull/5641)
- Fill annotations on function arguments and return values for all types
supported natively by PyO3.
[#​5634](https://redirect.github.com/PyO3/pyo3/pull/5634)
[#​5637](https://redirect.github.com/PyO3/pyo3/pull/5637)
[#​5639](https://redirect.github.com/PyO3/pyo3/pull/5639)
- Use `_typeshed.Incomplete` instead of `typing.Any` as default type
hint, to make it easier to spot incomplete trait implementations.
[#​5744](https://redirect.github.com/PyO3/pyo3/pull/5744)
- Use general Python expression syntax for type hints.
[#​5671](https://redirect.github.com/PyO3/pyo3/pull/5671)
##### Removed
- Remove all functionality deprecated in PyO3 0.25 and 0.26.
[#​5740](https://redirect.github.com/PyO3/pyo3/pull/5740)
- FFI definitions:
- Remove FFI definition `PyEval_GetCallStats` (removed from CPython in
Python 3.7).
[#​5590](https://redirect.github.com/PyO3/pyo3/pull/5590)
- Remove FFI definitions `PyEval_AcquireLock` and `PyEval_ReleaseLock`
on Python 3.13 and up.
[#​5590](https://redirect.github.com/PyO3/pyo3/pull/5590)
- Remove private FFI definitions `_PyObject_New`, `_PyObject_NewVar`,
`_PyObject_GC_Resize`, `_PyObject_GC_New`, and `_PyObject_GC_NewVar`.
[#​5591](https://redirect.github.com/PyO3/pyo3/pull/5591)
- Remove private FFI definitions `_PyDict_SetItem_KnownHash`,
`_PyDict_Next`, `_PyDict_NewPresized`, `_PyDict_Contains_KnownHash`, and
`_PyDict_Contains`.
[#​5659](https://redirect.github.com/PyO3/pyo3/pull/5659)
- Remove private FFI definitions `_PyFrameEvalFunction`,
`_PyInterpreterState_GetEvalFrameFunc` and
`_PyInterpreterState_SetEvalFrameFunc`.
[#​5711](https://redirect.github.com/PyO3/pyo3/pull/5711)
- Remove private FFI definitions `_PyImport_IsInitialized`,
`_PyImport_SetModule`, `_PyImport_SetModuleString`,
`_PyImport_AcquireLock`, `_PyImport_ReleaseLock`,
`_PyImport_FindBuiltin`, `_PyImport_FindExtensionObject`,
`_PyImport_FixupBuiltin`, and `_PyImport_FixupExtensionObject`.
[#​5737](https://redirect.github.com/PyO3/pyo3/pull/5737)
##### Fixed
- Fix `PyModuleMethods::add_submodule()` to use the last segment of the
submodule name as the attribute name on the parent module instead of
using the full name.
[#​5375](https://redirect.github.com/PyO3/pyo3/pull/5375)
- Link with libpython for Cygwin extension modules.
[#​5571](https://redirect.github.com/PyO3/pyo3/pull/5571)
- Link against the limited API DLL for Cygwin when abi3 is used.
[#​5574](https://redirect.github.com/PyO3/pyo3/pull/5574)
- Handle errors in `PyIterator` when calling `size_hint`
[#​5604](https://redirect.github.com/PyO3/pyo3/pull/5604)
- Link with libpython for iOS extension modules.
[#​5605](https://redirect.github.com/PyO3/pyo3/pull/5605)
- Correct `IntoPyObject` output type of `PyBackedStr` to be `PyString`,
not `PyAny`.
[#​5655](https://redirect.github.com/PyO3/pyo3/pull/5655)
- Fix `async` functions to return `None` rather than empty tuple `()`.
[#​5685](https://redirect.github.com/PyO3/pyo3/pull/5685)
- Fix compile error when using references to `#[pyclass]` types (e.g.
`&MyClass`) as arguments to async `#[pyfunction]`s.
[#​5725](https://redirect.github.com/PyO3/pyo3/pull/5725)
- FFI definitions:
- Fix FFI definition `PyMemberDescrObject.d_member` to use `PyMemberDef`
for Python 3.11+ (was incorrectly `PyGetSetDef`).
[#​5647](https://redirect.github.com/PyO3/pyo3/pull/5647)
- Mark FFI definition `PyThreadState_GetFrame` available with abi3 in
3.10+. [#​5711](https://redirect.github.com/PyO3/pyo3/pull/5711)
- Fix FFI definition `PyImport_GetModule` on PyPy.
[#​5737](https://redirect.github.com/PyO3/pyo3/pull/5737)
- `experimental-inspect`:
- fix `__new__` return type to be the built object type and not `None`.
[#​5555](https://redirect.github.com/PyO3/pyo3/pull/5555)
- fix imports of decorators.
[#​5618](https://redirect.github.com/PyO3/pyo3/pull/5618)
- fix the return type annotation of `PyResult<()>` (must be `None` and
not `tuple`)
[#​5674](https://redirect.github.com/PyO3/pyo3/pull/5674)
###
[`v0.27.2`](https://redirect.github.com/pyo3/pyo3/blob/HEAD/CHANGELOG.md#0272---2025-11-30)
[Compare
Source](https://redirect.github.com/pyo3/pyo3/compare/v0.27.1...v0.27.2)
##### Changed
- Disable subclassing `PyDict` on GraalPy (unsupported for now, may
crash at runtime).
[#​5653](https://redirect.github.com/PyO3/pyo3/pull/5653)
##### Fixed
- Fix crash when compiling on Rust 1.92+ with both debug assertions and
optimizations enabled.
[#​5638](https://redirect.github.com/PyO3/pyo3/pull/5638)
- Fix FFI definition of `PyDictObject` on PyPy.
[#​5653](https://redirect.github.com/PyO3/pyo3/pull/5653)
###
[`v0.27.1`](https://redirect.github.com/pyo3/pyo3/blob/HEAD/CHANGELOG.md#0271---2025-10-21)
[Compare
Source](https://redirect.github.com/pyo3/pyo3/compare/v0.27.0...v0.27.1)
##### Fixed
- Fix `clippy:declare_interior_mutable_const` warning from
`#[pyfunction]`.
[#​5538](https://redirect.github.com/PyO3/pyo3/pull/5538)
- Expose `pyo3::types::PySendResult` in public API.
[#​5539](https://redirect.github.com/PyO3/pyo3/pull/5539)
###
[`v0.27.0`](https://redirect.github.com/pyo3/pyo3/blob/HEAD/CHANGELOG.md#0270---2025-10-19)
[Compare
Source](https://redirect.github.com/pyo3/pyo3/compare/v0.26.0...v0.27.0)
##### Packaging
- Extend range of supported versions of `hashbrown` optional dependency
to include version 0.16.
[#​5428](https://redirect.github.com/PyO3/pyo3/pull/5428)
- Bump optional `num-bigint` dependency minimum version to 0.4.4.
[#​5471](https://redirect.github.com/PyO3/pyo3/pull/5471)
- Test against Python 3.14 final release.
[#​5499](https://redirect.github.com/PyO3/pyo3/pull/5499)
- Drop support for PyPy 3.9 and 3.10.
[#​5516](https://redirect.github.com/PyO3/pyo3/pull/5516)
- Provide a better error message when building an outdated PyO3 for a
too-new Python version.
[#​5519](https://redirect.github.com/PyO3/pyo3/pull/5519)
##### Added
- Add `FromPyObjectOwned` as convenient trait bound for `FromPyObject`
when the data is not borrowed from Python.
[#​4390](https://redirect.github.com/PyO3/pyo3/pull/4390)
- Add `Borrowed::extract`, same as `PyAnyMethods::extract`, but does not
restrict the lifetime by deref.
[#​4390](https://redirect.github.com/PyO3/pyo3/pull/4390)
- `experimental-inspect`: basic support for `#[derive(IntoPyObject)]`
(no struct fields support yet).
[#​5365](https://redirect.github.com/PyO3/pyo3/pull/5365)
- `experimental-inspect`: support `#[pyo3(get, set)]` and
`#[pyclass(get_all, set_all)]`.
[#​5370](https://redirect.github.com/PyO3/pyo3/pull/5370)
- Add `PyTypeCheck::classinfo_object` that returns an object that can be
used as parameter in `isinstance` or `issubclass`.
[#​5387](https://redirect.github.com/PyO3/pyo3/pull/5387)
- Implement `PyTypeInfo` on `datetime.*` types even when the limited API
is enabled.
[#​5388](https://redirect.github.com/PyO3/pyo3/pull/5388)
- Implement `PyTypeInfo` on `PyIterator`, `PyMapping` and `PySequence`.
[#​5402](https://redirect.github.com/PyO3/pyo3/pull/5402)
- Implement `PyTypeInfo` on `PyCode` when using the stable ABI.
[#​5403](https://redirect.github.com/PyO3/pyo3/pull/5403)
- Implement `PyTypeInfo` on `PyWeakrefReference` when using the stable
ABI. [#​5404](https://redirect.github.com/PyO3/pyo3/pull/5404)
- Add `pyo3::sync::RwLockExt` trait, analogous to `pyo3::sync::MutexExt`
for readwrite locks.
[#​5435](https://redirect.github.com/PyO3/pyo3/pull/5435)
- Add `PyString::from_bytes`.
[#​5437](https://redirect.github.com/PyO3/pyo3/pull/5437)
- Implement `AsRef<[u8]>` for `PyBytes`.
[#​5445](https://redirect.github.com/PyO3/pyo3/pull/5445)
- Add `CastError` and `CastIntoError`.
[#​5468](https://redirect.github.com/PyO3/pyo3/pull/5468)
- Add `PyCapsuleMethods::pointer_checked` and
`PyCapsuleMethods::is_valid_checked`.
[#​5474](https://redirect.github.com/PyO3/pyo3/pull/5474)
- Add `Borrowed::cast`, `Borrowed::cast_exact` and
`Borrowed::cast_unchecked`.
[#​5475](https://redirect.github.com/PyO3/pyo3/pull/5475)
- Add conversions for `jiff::civil::ISOWeekDate`.
[#​5478](https://redirect.github.com/PyO3/pyo3/pull/5478)
- Add conversions for `&Cstr`, `Cstring` and `Cow<Cstr>`.
[#​5482](https://redirect.github.com/PyO3/pyo3/pull/5482)
- add `#[pyclass(skip_from_py_object)]` option, to opt-out of the
`FromPyObject: PyClass + Clone` blanket impl.
[#​5488](https://redirect.github.com/PyO3/pyo3/pull/5488)
- Add `PyErr::add_note`.
[#​5489](https://redirect.github.com/PyO3/pyo3/pull/5489)
- Add `FromPyObject` impl for `Cow<Path>` & `Cow<OsStr>`.
[#​5497](https://redirect.github.com/PyO3/pyo3/pull/5497)
- Add `#[pyclass(from_py_object)]` pyclass option, to opt-in to the
extraction of pyclasses by value (requires `Clone`).
[#​5506](https://redirect.github.com/PyO3/pyo3/pull/5506)
##### Changed
- Rework `FromPyObject` trait for flexibility and performance:
[#​4390](https://redirect.github.com/PyO3/pyo3/pull/4390)
- Add a second lifetime to `FromPyObject`, to allow borrowing data from
Python objects (e.g. `&str` from Python `str`).
- Replace `extract_bound` with `extract`, which takes `Borrowed<'a, 'py,
PyAny>`.
- Optimize `FromPyObject` implementations for `Vec<u8>` and `[u8; N]`
from `bytes` and `bytearray`.
[#​5244](https://redirect.github.com/PyO3/pyo3/pull/5244)
- Deprecate `#[pyfn]` attribute.
[#​5384](https://redirect.github.com/PyO3/pyo3/pull/5384)
- Fetch type name dynamically on cast errors instead of using
`PyTypeCheck::NAME`.
[#​5387](https://redirect.github.com/PyO3/pyo3/pull/5387)
- Deprecate `PyTypeCheck::NAME` in favour of
`PyTypeCheck::classinfo_object` which provides the type information at
runtime. [#​5387](https://redirect.github.com/PyO3/pyo3/pull/5387)
- `PyClassGuard(Mut)` and `PyRef(Mut)` extraction now returns an opaque
Rust error
[#​5413](https://redirect.github.com/PyO3/pyo3/pull/5413)
- Fetch type name dynamically when exporting types implementing
`PyTypeInfo` with `#[pymodule_use]`.
[#​5414](https://redirect.github.com/PyO3/pyo3/pull/5414)
- Improve `Debug` representation of `PyBuffer<T>`.
[#​5442](https://redirect.github.com/PyO3/pyo3/pull/5442)
- `experimental-inspect`: change the way introspection data is emitted
in the binaries to avoid a pointer indirection and simplify parsing.
[#​5450](https://redirect.github.com/PyO3/pyo3/pull/5450)
- Optimize `Py<T>::drop` for the case when attached to the Python
interpreter.
[#​5454](https://redirect.github.com/PyO3/pyo3/pull/5454)
- Replace `DowncastError` and `DowncastIntoError` with `CastError` and
`CastIntoError`.
[#​5468](https://redirect.github.com/PyO3/pyo3/pull/5468)
- Enable fast-path for 128-bit integer conversions on `GraalPy`.
[#​5471](https://redirect.github.com/PyO3/pyo3/pull/5471)
- Deprecate `PyAnyMethods::downcast` functions in favour of
`Bound::cast` functions.
[#​5472](https://redirect.github.com/PyO3/pyo3/pull/5472)
- Make `PyTypeCheck` an `unsafe trait`.
[#​5473](https://redirect.github.com/PyO3/pyo3/pull/5473)
- Deprecate unchecked `PyCapsuleMethods`: `pointer()`, `reference()`,
and `is_valid()`.
[#​5474](https://redirect.github.com/PyO3/pyo3/pull/5474)
- Reduce lifetime of return value in `PyCapsuleMethods::reference`.
[#​5474](https://redirect.github.com/PyO3/pyo3/pull/5474)
- `PyCapsuleMethods::name` now returns `CapsuleName` wrapper instead of
`&CStr`. [#​5474](https://redirect.github.com/PyO3/pyo3/pull/5474)
- Deprecate `import_exception_bound` in favour of `import_exception`.
[#​5480](https://redirect.github.com/PyO3/pyo3/pull/5480)
- `PyList::get_item_unchecked`, `PyTuple::get_item_unchecked`, and
`PyTuple::get_borrowed_item_unchecked` no longer check for null values
at the provided index.
[#​5494](https://redirect.github.com/PyO3/pyo3/pull/5494)
- Allow converting naive datetime into chrono `DateTime<Local>`.
[#​5507](https://redirect.github.com/PyO3/pyo3/pull/5507)
##### Removed
- Removed `FromPyObjectBound` trait.
[#​4390](https://redirect.github.com/PyO3/pyo3/pull/4390)
##### Fixed
- Fix compilation failure on `wasm32-wasip2`.
[#​5368](https://redirect.github.com/PyO3/pyo3/pull/5368)
- Fix `OsStr` conversion for non-utf8 strings on Windows.
[#​5444](https://redirect.github.com/PyO3/pyo3/pull/5444)
- Fix issue with `cargo vendor` caused by gitignored build artifact
`emscripten/pybuilddir.txt`.
[#​5456](https://redirect.github.com/PyO3/pyo3/pull/5456)
- Stop leaking `PyMethodDef` instances inside `#[pyfunction]` macro
generated code.
[#​5459](https://redirect.github.com/PyO3/pyo3/pull/5459)
- Don't export definition of FFI struct `PyObjectObFlagsAndRefcnt` on
32-bit Python 3.14 (doesn't exist).
[#​5499](https://redirect.github.com/PyO3/pyo3/pull/5499)
- Fix failure to build for `abi3` interpreters on Windows using
maturin's built-in sysconfig in combination with the
`generate-import-lib` feature.
[#​5503](https://redirect.github.com/PyO3/pyo3/pull/5503)
- Fix FFI definitions `PyModule_ExecDef` and `PyModule_FromDefAndSpec2`
on PyPy. [#​5529](https://redirect.github.com/PyO3/pyo3/pull/5529)
###
[`v0.26.0`](https://redirect.github.com/pyo3/pyo3/blob/HEAD/CHANGELOG.md#0260---2025-08-29)
[Compare
Source](https://redirect.github.com/pyo3/pyo3/compare/v0.25.1...v0.26.0)
##### Packaging
- Bump hashbrown dependency to 0.15.
[#​5152](https://redirect.github.com/PyO3/pyo3/pull/5152)
- Update MSRV to 1.74.
[#​5171](https://redirect.github.com/PyO3/pyo3/pull/5171)
- Set the same maximum supported version for alternative interpreters as
for CPython.
[#​5192](https://redirect.github.com/PyO3/pyo3/pull/5192)
- Add optional `bytes` dependency to add conversions for `bytes::Bytes`.
[#​5252](https://redirect.github.com/PyO3/pyo3/pull/5252)
- Publish new crate `pyo3-introspection` to pair with the
`experimental-inspect` feature.
[#​5300](https://redirect.github.com/PyO3/pyo3/pull/5300)
- The `PYO3_BUILD_EXTENSION_MODULE` now causes the same effect as the
`extension-module` feature. Eventually we expect maturin and
setuptools-rust to set this environment variable automatically. Users
with their own build systems will need to do the same.
[#​5343](https://redirect.github.com/PyO3/pyo3/pull/5343)
##### Added
- Add `#[pyo3(warn(message = "...", category = ...))]` attribute for
automatic warnings generation for `#[pyfunction]` and `#[pymethods]`.
[#​4364](https://redirect.github.com/PyO3/pyo3/pull/4364)
- Add `PyMutex`, available on Python 3.13 and newer.
[#​4523](https://redirect.github.com/PyO3/pyo3/pull/4523)
- Add FFI definition `PyMutex_IsLocked`, available on Python 3.14 and
newer. [#​4523](https://redirect.github.com/PyO3/pyo3/pull/4523)
- Add `PyString::from_encoded_object`.
[#​5017](https://redirect.github.com/PyO3/pyo3/pull/5017)
- `experimental-inspect`: add basic input type annotations.
[#​5089](https://redirect.github.com/PyO3/pyo3/pull/5089)
- Add FFI function definitions for `PyFrameObject` from CPython 3.13.
[#​5154](https://redirect.github.com/PyO3/pyo3/pull/5154)
- `experimental-inspect`: tag modules created using `#[pymodule]` or
`#[pymodule_init]` functions as incomplete.
[#​5207](https://redirect.github.com/PyO3/pyo3/pull/5207)
- `experimental-inspect`: add basic return type support.
[#​5208](https://redirect.github.com/PyO3/pyo3/pull/5208)
- Add `PyCode::compile` and `PyCodeMethods::run` to create and execute
code objects.
[#​5217](https://redirect.github.com/PyO3/pyo3/pull/5217)
- Add `PyOnceLock` type for thread-safe single-initialization.
[#​5223](https://redirect.github.com/PyO3/pyo3/pull/5223)
- Add `PyClassGuard(Mut)` pyclass holders. In the future they will
replace `PyRef(Mut)`.
[#​5233](https://redirect.github.com/PyO3/pyo3/pull/5233)
- `experimental-inspect`: allow annotations in `#[pyo3(signature)]`
signature attribute.
[#​5241](https://redirect.github.com/PyO3/pyo3/pull/5241)
- Implement `MutexExt` for parking\_lot's/lock\_api `ReentrantMutex`.
[#​5258](https://redirect.github.com/PyO3/pyo3/pull/5258)
- `experimental-inspect`: support class associated constants.
[#​5272](https://redirect.github.com/PyO3/pyo3/pull/5272)
- Add `Bound::cast` family of functions superseding the
`PyAnyMethods::downcast` family.
[#​5289](https://redirect.github.com/PyO3/pyo3/pull/5289)
- Add FFI definitions `Py_Version` and `Py_IsFinalizing`.
[#​5317](https://redirect.github.com/PyO3/pyo3/pull/5317)
- `experimental-inspect`: add output type annotation for `#[pyclass]`.
[#​5320](https://redirect.github.com/PyO3/pyo3/pull/5320)
- `experimental-inspect`: support `#[pyclass(eq, eq_int, ord, hash,
str)]`. [#​5338](https://redirect.github.com/PyO3/pyo3/pull/5338)
- `experimental-inspect`: add basic support for
`#[derive(FromPyObject)]` (no struct fields support yet).
[#​5339](https://redirect.github.com/PyO3/pyo3/pull/5339)
- Add `Python::try_attach`.
[#​5342](https://redirect.github.com/PyO3/pyo3/pull/5342)
##### Changed
- Use `Py_TPFLAGS_DISALLOW_INSTANTIATION` instead of a `__new__` which
always fails for a `#[pyclass]` without a `#[new]` on Python 3.10 and
up. [#​4568](https://redirect.github.com/PyO3/pyo3/pull/4568)
- `PyModule::from_code` now defaults `file_name` to `<string>` if empty.
[#​4777](https://redirect.github.com/PyO3/pyo3/pull/4777)
- Deprecate `PyString::from_object` in favour of
`PyString::from_encoded_object`.
[#​5017](https://redirect.github.com/PyO3/pyo3/pull/5017)
- When building with `abi3` for a Python version newer than pyo3
supports, automatically fall back to an abi3 build for the latest
supported version.
[#​5144](https://redirect.github.com/PyO3/pyo3/pull/5144)
- Change `is_instance_of` trait bound from `PyTypeInfo` to
`PyTypeCheck`.
[#​5146](https://redirect.github.com/PyO3/pyo3/pull/5146)
- Many PyO3 proc macros now report multiple errors instead of only the
first one.
[#​5159](https://redirect.github.com/PyO3/pyo3/pull/5159)
- Change `MutexExt` return type to be an associated type.
[#​5201](https://redirect.github.com/PyO3/pyo3/pull/5201)
- Use `PyCallArgs` for `Py::call` and friends so they're equivalent to
their `Bound` counterpart.
[#​5206](https://redirect.github.com/PyO3/pyo3/pull/5206)
- Rename `Python::with_gil` to `Python::attach`.
[#​5209](https://redirect.github.com/PyO3/pyo3/pull/5209)
- Rename `Python::allow_threads` to `Python::detach`
[#​5221](https://redirect.github.com/PyO3/pyo3/pull/5221)
- Deprecate `GILOnceCell` type in favour of `PyOnceLock`.
[#​5223](https://redirect.github.com/PyO3/pyo3/pull/5223)
- Rename `pyo3::prepare_freethreaded_python` to `Python::initialize`.
[#​5247](https://redirect.github.com/PyO3/pyo3/pull/5247)
- Convert `PyMemoryError` into/from `io::ErrorKind::OutOfMemory`.
[#​5256](https://redirect.github.com/PyO3/pyo3/pull/5256)
- Deprecate `GILProtected`.
[#​5285](https://redirect.github.com/PyO3/pyo3/pull/5285)
- Move `#[pyclass]` docstring formatting from import time to compile
time. [#​5286](https://redirect.github.com/PyO3/pyo3/pull/5286)
- `Python::attach` will now panic if the Python interpreter is in the
process of shutting down.
[#​5317](https://redirect.github.com/PyO3/pyo3/pull/5317)
- Add fast-path to `PyTypeInfo::type_object` for `#[pyclass]` types.
[#​5324](https://redirect.github.com/PyO3/pyo3/pull/5324)
- Deprecate `PyObject` type alias for `Py<PyAny>`.
[#​5325](https://redirect.github.com/PyO3/pyo3/pull/5325)
- Rename `Python::with_gil_unchecked` to `Python::attach_unchecked`.
[#​5340](https://redirect.github.com/PyO3/pyo3/pull/5340)
- Rename `Python::assume_gil_acquired` to `Python::assume_attached`.
[#​5354](https://redirect.github.com/PyO3/pyo3/pull/5354)
##### Removed
- Remove FFI definition of internals of `PyFrameObject`.
[#​5154](https://redirect.github.com/PyO3/pyo3/pull/5154)
- Remove `Eq` and `PartialEq` implementations on `PyGetSetDef` FFI
definition.
[#​5196](https://redirect.github.com/PyO3/pyo3/pull/5196)
- Remove private FFI definitions `_Py_IsCoreInitialized` and
`_Py_InitializeMain`.
[#​5317](https://redirect.github.com/PyO3/pyo3/pull/5317)
##### Fixed
- Use critical section in `PyByteArray::to_vec` on freethreaded build to
replicate GIL-enabled "soundness".
[#​4742](https://redirect.github.com/P
> ✂ **Note**
>
> PR body was truncated to here.
</details>
---
### Configuration
📅 **Schedule**: (UTC)
- Branch creation
- At any time (no schedule defined)
- Automerge
- At any time (no schedule defined)
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box
---
This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/codegen-sh/graph-sitter).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yMzEuMSIsInVwZGF0ZWRJblZlciI6IjQzLjIzMS4xIiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCIsImxhYmVscyI6W119-->
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>1 parent ebd19e9 commit 63bb23d
2 files changed
Lines changed: 13 additions & 61 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
0 commit comments