This is the first version to fully support embedding the newly released Python 3.11.
Changes:
Allow pybind11::capsule constructor to take null destructor pointers. #4221
embed.h was changed so that PYTHONPATH is used also with Python 3.11 (established behavior). #4119
A PYBIND11_SIMPLE_GIL_MANAGEMENT option was added (cmake, C++ define), along with many additional tests in test_gil_scoped.py. The option may be useful to try when debugging GIL-related issues, to determine if the more complex default implementation is or is not to blame. See #4216 for background. WARNING: Please be careful to not create ODR violations when using the option: everything that is linked together with mutual symbol visibility needs to be rebuilt. #4216
PYBIND11_EXPORT_EXCEPTION was made non-empty only under macOS. This makes Linux builds safer, and enables the removal of warning suppression pragmas for Windows. #4298
Bug fixes:
Fixed a bug where UnicodeDecodeError was not propagated from various py::str ctors when decoding surrogate utf characters. #4294
Revert perfect forwarding for make_iterator. This broke at least one valid use case. May revisit later. #4234
Fix support for safe casts to void* (regression in 2.10.0). #4275
Make augmented assignment operators non-const for the object-api. Behavior was previously broken for augmented assignment operators. #4065
Add proper error checking to C++ bindings for Python list append and insert. #4208
Work-around for Nvidia's CUDA nvcc compiler in versions 11.4.0 - 11.8.0. #4220
A workaround for PyPy was added in the py::error_already_set implementation, related to PR #1895 released with v2.10.0. #4079
Fixed compiler errors when C++23 std::forward_like is available. #4136
Properly raise exceptions in contains methods (like when an object in unhashable). #4209
Further improve another error in exception handling. #4232
get_local_internals() was made compatible with finalize_interpreter(), fixing potential freezes during interpreter finalization. #4192
Performance and style:
Reserve space in set and STL map casters if possible. This will prevent unnecessary rehashing / resizing by knowing the number of keys ahead of time for Python to C++ casting. This improvement will greatly speed up the casting of large unordered maps and sets. #4194
GIL RAII scopes are non-copyable to avoid potential bugs. #4183
Explicitly default all relevant ctors for pytypes in the PYBIND11_OBJECT macros and enforce the clang-tidy checks modernize-use-equals-default in macros as well. #4017
Optimize iterator advancement in C++ bindings. #4237
Use the modern PyObject_GenericGetDict and PyObject_GenericSetDict for handling dynamic attribute dictionaries. #4106
Document that users should use PYBIND11_NAMESPACE instead of using pybind11 when opening namespaces. Using namespace declarations and namespace qualification remain the same as pybind11. This is done to ensure consistent symbol visibility. #4098
This is the first version to fully support embedding the newly released Python 3.11.
Changes:
Allow pybind11::capsule constructor to take null destructor pointers.
[#4221](https://github.com/pybind/pybind11/issues/4221) <https://github.com/pybind/pybind11/pull/4221>_
embed.h was changed so that PYTHONPATH is used also with Python 3.11
(established behavior).
[#4119](https://github.com/pybind/pybind11/issues/4119) <https://github.com/pybind/pybind11/pull/4119>_
A PYBIND11_SIMPLE_GIL_MANAGEMENT option was added (cmake, C++ define),
along with many additional tests in test_gil_scoped.py. The option may be
useful to try when debugging GIL-related issues, to determine if the more
complex default implementation is or is not to blame. See #4216 for
background. WARNING: Please be careful to not create ODR violations when
using the option: everything that is linked together with mutual symbol
visibility needs to be rebuilt.
[#4216](https://github.com/pybind/pybind11/issues/4216) <https://github.com/pybind/pybind11/pull/4216>_
PYBIND11_EXPORT_EXCEPTION was made non-empty only under macOS. This makes
Linux builds safer, and enables the removal of warning suppression pragmas for
Windows.
[#4298](https://github.com/pybind/pybind11/issues/4298) <https://github.com/pybind/pybind11/pull/4298>_
Bug fixes:
Fixed a bug where UnicodeDecodeError was not propagated from various
py::str ctors when decoding surrogate utf characters.
[#4294](https://github.com/pybind/pybind11/issues/4294) <https://github.com/pybind/pybind11/pull/4294>_
Revert perfect forwarding for make_iterator. This broke at least one
valid use case. May revisit later.
[#4234](https://github.com/pybind/pybind11/issues/4234) <https://github.com/pybind/pybind11/pull/4234>_
Fix support for safe casts to void* (regression in 2.10.0).
[#4275](https://github.com/pybind/pybind11/issues/4275) <https://github.com/pybind/pybind11/pull/4275>_
Fix char8_t support (regression in 2.9).
[#4278](https://github.com/pybind/pybind11/issues/4278) <https://github.com/pybind/pybind11/pull/4278>_
Unicode surrogate character in Python exception message leads to process
termination in error_already_set::what().
[#4297](https://github.com/pybind/pybind11/issues/4297) <https://github.com/pybind/pybind11/pull/4297>_
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually 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 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)
Bumps pybind11 from 2.10.0 to 2.10.1.
Release notes
Sourced from pybind11's releases.
Changelog
Sourced from pybind11's changelog.
... (truncated)
Commits
80dc998
chore: bump versions for 2.10.1f2ee641
docs: prepare for 2.10.1 release (#4279)3fb36a9
fix: unicode surrogate character in Python exception message. (#4297)15fde1d
AddPYBIND11_SIMPLE_GIL_MANAGEMENT
option (cmake, C++ define) (#4216)5b395c9
fix: improve bytes to str decoding error handling (#4294)738a6f8
ci: move to final release of 3.11 (#4286)1f187d9
Fix char8_t support (#4278)0e82c36
fix: add flag for overriding classic Python search values (#4195)ce63bcb
Fix casts to void* (#4275)305c471
fix: Revert pfect args make iterator (#4234)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually 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 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)