-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
Incompatible change in internal string representation (encountered with Rust bindings) (?) #128972
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
Comments
Hi, thanks for the report! Can you please try to come up with a reproducer that does not include |
I don't think it's a CPython problem. PyO3 has to replicate the C API at the ABI level, so it's not a surprise when bumping python versions that if structures change we need to make adjustments. The PyUnicode data access macros are a known problem for PyO3 and to be honest I think the better option might be to just remove our mapping of them. But we can discuss that downstream. |
I suspect the "offending" change would be #128196, but yeah--we won't guarantee any stability with the internals, especially in the alpha phase. Though, I am having some thoughts about whether or not the structure of cc @encukou for the stability rules here. |
By my reading of PEP-387, backwards-incompatible changes to I see #128196 preserves C API compatibility but introduces an implementation-defined C feature ( |
If we have to guarantee object layout stuff, one possible negotiation point would be just change for the free-threaded build because it is kind of an experimental build, so some of the breaking changes will be acceptable. (And we already break ABI compatibility between the default build and the free-threaded build) cc @colesbury |
… layout. Add `_Py_ALIGN_AS` as per C API WG vote: capi-workgroup/decisions#61 This patch only adds it to free-threaded builds; the `#ifdef Py_GIL_DISABLED` can be removed in the future. Use this to revert `PyASCIIObject` memory layout for non-free-threaded builds. The long-term plan is to deprecate the entire struct; until that happens it's better to keep it unchanged, as courtesy to people that rely on it despite it not being stable ABI.
Not sure if it's the right place to ask, but here it is.
I'm attempting to introduce 3.14 support in
pyo3
(PyO3/pyo3#4811). I've encountered test failures involving UCS and refcounts targeting Windows and Linux. Invokingcargo test --no-default-features --lib --tests
, one example of failure is here: https://github.com/clin1234/pyo3/actions/runs/12834317749/job/35791414368. The Python version used for testing 3.14 is 3.14.0a4.However, running the same command with Python 3.14.0a3 running on Fedora Rawhide locally, I have encountered no test failures whatsoever.
And yes, I have pinged @davidhewitt on this matter.
Linked PRs
_Py_ALIGN_AS
and revertPyASCIIObject
memory layout. #133085The text was updated successfully, but these errors were encountered: