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

pystring: disable PyString::data on big-endian targets #1834

Merged
merged 1 commit into from
Aug 27, 2021

Conversation

davidhewitt
Copy link
Member

Based on the discussion in #1824, this PR disables the PyString::data API on big-endian architectures.

Because of the lack of well-definedness of the underlying C bitfield, I also think it's appropriate to mark the API as unsafe. Users are then free to use it as they please; the safety note specifies that they are responsible for confirming it works correctly on their target.

If merged, I'll backport to 0.14 and release a 0.14.4.

cc @indygreg - this allows PyOxidizer to continue to use this API as needed, with explicit acknowledgement of the risks!

Copy link
Contributor

@indygreg indygreg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change seems reasonable to me. I agree with code compilation guard and marking the API as unsafe.

We can always bring back support of a safe API once CPython exposes proper function APIs for reading the bitfield.

@messense messense merged commit 868c591 into PyO3:main Aug 27, 2021
@davidhewitt davidhewitt deleted the pystring-data-big-endian branch August 27, 2021 06:00
@davidhewitt davidhewitt mentioned this pull request Aug 28, 2021
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.

4 participants