Skip to content

conversions: fix FromPyObject impl for uuid::Uuid for big-endian #5161

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

Merged
merged 1 commit into from
May 26, 2025

Conversation

decathorpe
Copy link
Contributor

The "to_le()" conversion on the u128 seems to be just wrong. See #5160 for a more thorough investigation that led me to this simple "delete 8 characters to fix the problem" fix :)

Note that it looks like this implementation has always been wrong since it was originally added ... I'll likely end up backporting this change to older PyO3 versions that we still need to support in Fedora Linux and EPEL.

Fixes #5160

Copy link
Member

@bschoenmaeckers bschoenmaeckers left a comment

Choose a reason for hiding this comment

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

The reason to_le was originally used here is because pydantic-core did the same (see pydantic/pydantic-core#1372), and it was thought to be necessary. However, that change was later reverted in pydantic/pydantic-core#1393, as it turned out to be unnecessary due to a fix in PyO3 v0.22.1.

So this usage should definitely be removed here as well. 👍

@bschoenmaeckers
Copy link
Member

Can you please add a changelog entry in the newsfragments folder, so we can merge this fix.

The "to_le()" conversion on the u128 seems to be just wrong.
@decathorpe
Copy link
Contributor Author

Done, thank you for taking a look!

Merged via the queue into PyO3:main with commit b8b7546 May 26, 2025
43 of 45 checks passed
davidhewitt pushed a commit that referenced this pull request Jun 11, 2025
The "to_le()" conversion on the u128 seems to be just wrong.
davidhewitt pushed a commit that referenced this pull request Jun 12, 2025
The "to_le()" conversion on the u128 seems to be just wrong.
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.

FromPyObject impl for uuid::Uuid broken on big-endian architectures
2 participants