-
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
ffi: add PyConfig::warn_default_encoding to 3.10+ #2370
Conversation
036eb76
to
4c6d182
Compare
I confirmed that this patch fixes the crashes that occur with PyOxidizer when using 3.10. |
CHANGELOG.md
Outdated
@@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
|
|||
- Fixed incorrectly disabled FFI definition `PyThreadState_DeleteCurrent`. [#2357](https://github.com/PyO3/pyo3/pull/2357) | |||
- Correct FFI definition `PyEval_EvalCodeEx` to take `*const *mut PyObject` array arguments instead of `*mut *mut PyObject` (this was changed in CPython 3.6). [#2368](https://github.com/PyO3/pyo3/pull/2368) | |||
- Added missing `warn_default_encoding` field to `PyConfig` on 3.10+. [#2370](https://github.com/PyO3/pyo3/pull/2370) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be nice to mention the symptom - PyOxidizer crashes - here so that people experiencing them can match that to the changelog.
Argh, I'm sorry we missed this. Given that 0.17 release is probably still a little way away (got a few unfinished bits merged), we should perhaps backport this to 0.16? |
A passing thought - would you be willing to add a new file |
I would strongly prefer a backport and 0.16.x release at your earliest convenience.
If it isn't too much work, yes. However, I'm unsure the state of your testing infra. These interpreter-level config options result in global variables getting set in CPython and CPython - especially older versions - isn't great about ensuring all values are normalized during interpreter initialization or finalization. For equivalent tests I already have in the |
👍 I'll do my best to find time to push this out on Saturday.
My understand was that cargo runs each test file from the |
4c6d182
to
c9a810f
Compare
Thank you!
Yes, I think that's how Cargo works. But I was hoping to avoid separate files because the repetition gets tedious. For |
It also looks like I'll likely also send a PR to add 3.11 changes to |
This field was added in 3.10 but we missed it. This was causing offsets of subsequent fields to be wrong. This could lead to unexpected behavior or even crashes.
c9a810f
to
03cb561
Compare
e6ddbdc
to
62373c6
Compare
Thanks! I've managed this evening to push a regression test to this branch which should help ensure things keep working in the future (I could verify it failed on |
62373c6
to
fc6faff
Compare
Aha perfect, the test now fails on 3.11 alpha which I guess is expected! For speed I'll just merge #2371 which has both your commits and then verify with a new MR for the test. |
This fixes a nasty bug on Python 3.10 leading to runtime crashes and wrong behavior. (PyO3/pyo3#2370)
This field was added in 3.10 but we missed it. This was causing
offsets of subsequent fields to be wrong. This could lead to
unexpected behavior or even crashes.
This bug is causing many PyOxidizer built binaries to crash when using 3.10.