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

Convert more of src/pkcs7.rs to new pyo3 APIs #10741

Merged
merged 1 commit into from
Apr 5, 2024

Conversation

facutuesca
Copy link
Contributor

Part of #10676

This fixes all except one of the migration warnings for src/pkcs7.rs. The remaining warning is:

error: use of deprecated associated function `pyo3::types::PyBytes::new`: `PyBytes::new` will be replaced by `PyBytes::new_bound` in a future PyO3 version
   --> src/pkcs7.rs:168:54
    |
168 |             let digest_bytes = pyo3::types::PyBytes::new(py, &digest);
    |       

which, when fixed, causes the following compilation error:

error[E0597]: `digest_bytes` does not live long enough
   --> src/pkcs7.rs:172:40
    |
168 |             let digest_bytes = pyo3::types::PyBytes::new_bound(py, &digest);
    |                 ------------ binding `digest_bytes` declared here
...
172 |                     asn1::parse_single(digest_bytes.as_bytes()).unwrap(),
    |                                        ^^^^^^^^^^^^ borrowed value does not live long enough
...
194 |         };
    |         - `digest_bytes` dropped here while still borrowed

cc @alex @reaperhulk

@alex alex enabled auto-merge (squash) April 5, 2024 14:59
@facutuesca
Copy link
Contributor Author

Another GHA error:

.nox/tests/lib/python3.12/site-packages/_pytest/doctest.py:426: in collect
    import doctest
E   SyntaxError: source code string cannot contain null bytes

@alex alex merged commit 07afd49 into pyca:main Apr 5, 2024
58 checks passed
@facutuesca facutuesca deleted the pkcs7-pyo3 branch April 5, 2024 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants