You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not a new failure, but until now, we only ran tests with the "default" features enabled during package builds for Fedora Linux. I realized that I could turn on the "full" feature set without additional maintenance burden, and thought that would be a good idea to increase test coverage for more features on different architectures / Python versions.
Turns out, there's test failures in the "uuid" conversion feature that we hadn't hit because that feature wasn't enabled when we ran the test suite:
These failures are from pyo3 0.24.2. But this code (in src/conversions/uuid.rs) hasn't changed since it was initially added in 5c363b5 so as far as I can tell, this should always have failed (I can run those tests with pyo3 0.23 and 0.25 too, if needed).
Indeed, the FromPyObject impl does this to convert from an 128-bit number to the UUID - Uuid::from_u128(uuid_int.to_le()) - this hard-codes converting the u128 value to little-endian bytes, which is a noop on little-endian architectures and seems to be just plain wrong on big-endian architectures.
Patching the to_le() call out makes the tests pass on all architectures. I'll submit a PR for this change shortly.
The text was updated successfully, but these errors were encountered:
This is not a new failure, but until now, we only ran tests with the "default" features enabled during package builds for Fedora Linux. I realized that I could turn on the "full" feature set without additional maintenance burden, and thought that would be a good idea to increase test coverage for more features on different architectures / Python versions.
Turns out, there's test failures in the "uuid" conversion feature that we hadn't hit because that feature wasn't enabled when we ran the test suite:
These failures are from pyo3 0.24.2. But this code (in src/conversions/uuid.rs) hasn't changed since it was initially added in 5c363b5 so as far as I can tell, this should always have failed (I can run those tests with pyo3 0.23 and 0.25 too, if needed).
Looking at the test code, the assertion that causes these failures (except for the trivial cases where endianness doesn't matter) is this one: https://github.com/PyO3/pyo3/blob/v0.24.2/src/conversions/uuid.rs#L148
Which is strange, because the assertion in the Python code further up seems to pass: https://github.com/PyO3/pyo3/blob/v0.24.2/src/conversions/uuid.rs#L137
So as far as I can tell, the only place that is going wrong seems to be
let py_result: Uuid = py_uuid.extract().unwrap();
at https://github.com/PyO3/pyo3/blob/v0.24.2/src/conversions/uuid.rs#L147.Indeed, the
FromPyObject
impl does this to convert from an 128-bit number to the UUID -Uuid::from_u128(uuid_int.to_le())
- this hard-codes converting the u128 value to little-endian bytes, which is a noop on little-endian architectures and seems to be just plain wrong on big-endian architectures.Patching the
to_le()
call out makes the tests pass on all architectures. I'll submit a PR for this change shortly.The text was updated successfully, but these errors were encountered: