-
Notifications
You must be signed in to change notification settings - Fork 763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose PyErr_WriteUnraisable #2884
Comments
I fully support this! I've nearly added this in the past for various reasons (as a Where do you see the limitation of 3.8 and later? My impression is that this is also available on 3.7 (i.e. oldest version of Python which we currently support). |
Please feel free to send as PR if you wish, otherwise I'll get around to this within a couple weeks (before the next release at a minimum). |
Maybe it works on 3.7, I'm not sure. I took that information from
I can try to make a PR when I find some time for it. I'm assuming it generally is probably relatively non controversial, particularly if it turns out it works with 3.7. |
2873: A new example that shows how to integrate Python plugins that use pyclasses into a Rust app r=davidhewitt a=alexpyattaev Example showing integration of a Python plugin into a Rust app while having option to test pyclass based API without the main app. This also illustrates some aspects related to import of Python modules into a Rust app while also having an API module available for the Python code to be able to produce Rust objects. CI seems to fail on my local machine for reasons unrelated to the example just added: ``` error: unused macro definition: `check_struct` --> pyo3-ffi-check/src/main.rs:13:18 | 13 | macro_rules! check_struct { | ^^^^^^^^^^^^ | ``` 2889: Added support for PyErr_WriteUnraisable r=davidhewitt a=mitsuhiko Fixes #2884 2923: hygiene: fix `#[pymethods(crate = "...")]` r=davidhewitt a=davidhewitt Got to the bottom of the hygiene issue in test of #2914 Turns out that `#[pymethods] #[pyo3(crate = "...")]` works, but `#[pymethods(crate = "...")]` was ignoring the argument. Added a tweak to fix this and a snippet in the hygiene test (which fails on `main`). 2924: remove unneeded into_iter calls r=davidhewitt a=davidhewitt Clippy complaining about these to me this morning locally. Co-authored-by: Alex Pyattaev <alex.pyattaev@gmail.com> Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com> Co-authored-by: Armin Ronacher <armin.ronacher@active-4.com>
2873: A new example that shows how to integrate Python plugins that use pyclasses into a Rust app r=davidhewitt a=alexpyattaev Example showing integration of a Python plugin into a Rust app while having option to test pyclass based API without the main app. This also illustrates some aspects related to import of Python modules into a Rust app while also having an API module available for the Python code to be able to produce Rust objects. CI seems to fail on my local machine for reasons unrelated to the example just added: ``` error: unused macro definition: `check_struct` --> pyo3-ffi-check/src/main.rs:13:18 | 13 | macro_rules! check_struct { | ^^^^^^^^^^^^ | ``` 2889: Added support for PyErr_WriteUnraisable r=davidhewitt a=mitsuhiko Fixes #2884 Co-authored-by: Alex Pyattaev <alex.pyattaev@gmail.com> Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com> Co-authored-by: Armin Ronacher <armin.ronacher@active-4.com>
Since you sometimes might have some situations where Rust code that is infallible really likes to call into a Python callback, you end up with a horrible situation where all you can do is log the error.
However with Python 3.8 and later you can report such errors so they can be trapped. It would be nice to have a way to do this without unsafe code:
I propose to add a
write_unraisable()
method directly ontoPyErr
for this purpose.The text was updated successfully, but these errors were encountered: