◐ Shell
clean mode source ↗

bpo-32493: Fix uuid.uuid1() on FreeBSD. by serhiy-storchaka · Pull Request #7098 · python/cpython

@vstinner

On FreeBSD, there are uuid_enc_le() and uuid_enc_be() functions to encode a uuid_t type into an octet stream in little-endian and big-endian byte-order, respectively.
https://www.freebsd.org/cgi/man.cgi?query=uuid_create

I don't think if it would help, these functions don't seem to be portable.

@serhiy-storchaka

Good point Victor! These functions are supported on all three open BSD systems, and it would be more convenient to just use them. But it is not part of the DCE RPC API and is not supported on AIX. Actually I don't know whether on AIX uuid_create() creates platform-dependent or big-endian representation. If the latter, than this PR is incorrect, and we need to use uuid_enc_be() on *BSD only.

@ned-deily

Can we just correctly fix the *BSDs while leaving the existing AIX code as is for 3.7.0? We consider FreeBSD to be a atable platform whereas AIX is more in the "best effort" category.

@serhiy-storchaka

See an alternate solution in #7099.

@vstinner

I prefer to handle endianness in _uuid, so I chose to merge the alternative PR #7099.