Skip to content
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

Upgrade pyo3 to 0.10.1 #6

Merged
merged 1 commit into from
Jun 22, 2020
Merged

Upgrade pyo3 to 0.10.1 #6

merged 1 commit into from
Jun 22, 2020

Conversation

messense
Copy link
Contributor

pyo3 0.10 added catch_unwind! macro to prevent panics crossing ffi boundaries PyO3/pyo3#797 , which resolves #5, although ideally we should define some specific exceptions, but hey at least it's not unsound anymore.

In [1]: import cramjam

In [2]: cramjam.snappy_decompress(b'abcdefgh')
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: StreamHeader { byte: 97 } }', src/snappy.rs:21:35
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
---------------------------------------------------------------------------
PanicException                            Traceback (most recent call last)
<ipython-input-2-1d4c0e441753> in <module>
----> 1 cramjam.snappy_decompress(b'abcdefgh')

PanicException: called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: StreamHeader { byte: 97 } }

@milesgranger
Copy link
Owner

milesgranger commented Jun 22, 2020

Fantastic, thank you! I agree, it was something on the back-burner to fix and add better exception handling. 👍 As you've stated this resolved #5, I've made a different issue for this in #7

@milesgranger milesgranger merged commit 2ad9716 into milesgranger:master Jun 22, 2020
@messense messense deleted the feature/pyo3-0-10 branch June 22, 2020 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic on invalid input is bad
2 participants