You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This release is a security fix for the PyString::from_object method, which passed &str data to the Python C API without checking for a terminating nul byte. All historical PyO3 versions are affected, and we recommend you upgrade if you are using PyString::from_object. Thank you to @vthib for the report and @Dr-Emann for the fix. A RUSTSEC advisory will be published shortly.
Aside from the security fix, this release contains a number of other non-breaking additions:
An abi3-py313 feature to support compiling with the Python 3.13 stable ABI.
PyAnyMethods::getattr_opt to get optional attributes without paying the cost of a Python exception when the attribute in question does not exist.
Constructor for PyInt::new.
with_critical_section2 for locking two objects at the same time on the free-threaded build.
Fix for a PyO3 0.24.0 regression with Option<&str> and Option<&T> (where T: PyClass) function arguments no longer being permitted
There are also a few other small bug fixes for edge cases, mostly related to compile errors from PyO3's macro code.
Thank you to the following contributors for the improvements:
This release is an incremental improvement of refinements and optimizations following the new APIs established in PyO3's last few releases.
Support for jiff datetime conversions have been added, and also UUID conversions.
The FromPyObject derive macro has gained new #[pyo3(default = ...)] and #[pyo3(rename_all = ...)] options, and the IntoPyObject derive macro has gained a new #[pyo3(into_py_with = ...)] option.
PyO3 will now pass positional arguments to Python functions using the "vectorcall" protocol in many cases, which should be an optimization over the previous behaviour (of creating a Python tuple of positional arguments).
Many methods on iterators of Python collections have been optimized.
There are also many other incremental improvements, bug fixes and smaller features.
Thank you to everyone who contributed code, documentation, design ideas, bug reports, and feedback. The following contributors' commits are included in this release:
Add optional jiff dependency to add conversions for jiff datetime types. #4823
Add optional uuid dependency to add conversions for uuid::Uuid. #4864
Bump minimum supported inventory version to 0.3.5. #4954
Added
Add PyIterator::send method to allow sending values into a python generator. #4746
Add PyCallArgs trait for passing arguments into the Python calling protocol. This enabled using a faster calling convention for certain types, improving performance. #4768
Add #[pyo3(default = ...'] option for #[derive(FromPyObject)] to set a default value for extracted fields of named structs. #4829
Add #[pyo3(into_py_with = ...)] option for #[derive(IntoPyObject, IntoPyObjectRef)]. #4850
Add FFI definitions PyThreadState_GetFrame and PyFrame_GetBack. #4866
Optimize last for BoundListIterator, BoundTupleIterator and BorrowedTupleIterator. #4878
Optimize Iterator::count() for PyDict, PyList, PyTuple & PySet. #4878
Optimize nth, nth_back, advance_by and advance_back_by for BoundTupleIterator#4897
Add support for types.GenericAlias as pyo3::types::PyGenericAlias. #4917
Add MutextExt trait to help avoid deadlocks with the GIL while locking a std::sync::Mutex. #4934
Add #[pyo3(rename_all = "...")] option for #[derive(FromPyObject)]. #4941
Changed
Optimize nth, nth_back, advance_by and advance_back_by for BoundListIterator. #4810
Use DerefToPyAny in blanket implementations of From<Py<T>> and From<Bound<'py, T>> for PyObject. #4593
Map io::ErrorKind::IsADirectory/NotADirectory to the corresponding Python exception on Rust 1.83+. #4747
PyAnyMethods::call and friends now require PyCallArgs for their positional arguments. #4768
Expose FFI definitions for PyObject_Vectorcall(Method) on the stable abi on 3.12+. #4853
#[pyo3(from_py_with = ...)] now take a path rather than a string literal #4860
You can trigger a rebase of this PR by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase will rebase this PR
@dependabot recreate will recreate this PR, overwriting any edits that have been made to it
@dependabot merge will merge this PR after your CI passes on it
@dependabot squash and merge will squash and merge this PR after your CI passes on it
@dependabot cancel merge will cancel a previously requested merge and block automerging
@dependabot reopen will reopen this PR if it is closed
@dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
@dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
@dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the Security Alerts page.
Note
Automatic rebases have been disabled on this pull request as it has been open for over 30 days.
dependabotbot
added
Changed
Required label for PR that categorizes merge commit message as "Changed" for changelog
dependencies
Pull requests that update a dependency file
rust
Pull requests that update Rust code
labels
Oct 16, 2025
'This PR has been flagged as stale due to no activity for over 60
days. It will not be automatically closed, but it has been given
a stale-pr label and should be manually reviewed.'
OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting @dependabot ignore this major version or @dependabot ignore this minor version. You can also ignore all major, minor, or patch releases for a dependency by adding an ignore condition with the desired update_types to your config file.
If you change your mind, just re-open this PR and I'll resolve any conflicts on it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ChangedRequired label for PR that categorizes merge commit message as "Changed" for changelogdependenciesPull requests that update a dependency filerustPull requests that update Rust codestale-pr
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bumps pyo3 from 0.22.6 to 0.24.1.
Release notes
Sourced from pyo3's releases.
... (truncated)
Changelog
Sourced from pyo3's changelog.
... (truncated)
Commits
a213b36release: 0.24.1 (#5021)d85a02dsplitPyFunctionArgumentto specializeOption(#5002)c37a50aAdd example of more complex exceptions (#5014)dcacb9bSimplify PyFunctionArgument impl on &Bound<T> (#5018)03c31c5fix#[pyfunction]option parsing (#5015)0f49eb1docs: Remove examples with outdated PyO3 and unmaintained projects (#4952)1b00b0dimplementPyCallArgsfor borrowed types (#5013)5caaa37fix: convert to cstrings in PyString::from_object (#5008)4aca459docs: guide - add link to tables and traits (#5001)0452c0ereplace quansight-labs/setup-python with actions/setup-python (#5007)You can trigger a rebase of this PR by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot mergewill merge this PR after your CI passes on it@dependabot squash and mergewill squash and merge this PR after your CI passes on it@dependabot cancel mergewill cancel a previously requested merge and block automerging@dependabot reopenwill reopen this PR if it is closed@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)You can disable automated security fix PRs for this repo from the Security Alerts page.
Note
Cursor Bugbot is generating a summary for commit 4e3d95e. Configure here.