Uh oh!
There was an error while loading. Please reload this page.
bpo-32493: Fix uuid.uuid1() on FreeBSD. - #7099
Conversation
ned-deily
commented
May 24, 2018
For what it's worth, this approach looks to me to be cleaner and simpler than that in #7098. I'm not the right person to give a thorough technical review. But perhaps we can merge this just to master initially and see what happens with buildbots there before backporting to 3.7. Unlike some of the other blocker issues for 3.7, this one is a real user-visibile bug, no? |
ned-deily
commented
May 24, 2018
@vstinner, any opinion? |
| uint32_t status; | ||
| uuid_create(&uuid, &status); | ||
| # if defined(HAVE_UUID_ENC_BE) | ||
| unsigned char buf[sizeof(uuid)]; |
There was a problem hiding this comment.
The size should be 16 bytes.
https://www.freebsd.org/cgi/man.cgi?query=uuid_create
"must be large enough to hold the 16-octet binary UUID"
There was a problem hiding this comment.
Since @ned-deily wants this fix, I took the liberty of fixing this issue myself.
There was a problem hiding this comment.
Wait. My change only modified the size of the buffer, but not configure, not the call to Py_BuildValue two lines below. I reverted my change.
Anyway, the module constructor has an assertion for sizeof(uuid_t) == 16.
fbfe6bf to
fd869ceComparevstinner
commented
May 24, 2018
And now GitHub only shows ... nothing, all these commits and the removal of commits are hidden on this page :-( |
vstinner
commented
May 24, 2018
@serhiy-storchaka: Sorry, it seems like we worked together on the same branch, your branch :-/ I will no longer touch this branch. I consider that the current code using sizeof(uuid_t) is fine. If you want to use 16, it's up to you. IMHO sizeof(uuid_t) should always be 16, if it's not, we will get a safe Python exception. I prefer to merge the current PR to quickly fix Python 3.7 for the 3.7rc1 release. |
miss-islington
commented
May 24, 2018
Thanks @serhiy-storchaka for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7. |
bedevere-bot
commented
May 24, 2018
GH-7104 is a backport of this pull request to the 3.7 branch. |
Use uuid_enc_be() if available to encode UUID to bytes as big endian. (cherry picked from commit 17d8830) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
An alternate solution using
uuid_enc_be().https://bugs.python.org/issue32493