Sorry, something went wrong.
|
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? |
Sorry, something went wrong.
| 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"
Sorry, something went wrong.
There was a problem hiding this comment.
Since @ned-deily wants this fix, I took the liberty of fixing this issue myself.
Sorry, something went wrong.
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.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM.
Sorry, something went wrong.
And now GitHub only shows ... nothing, all these commits and the removal of commits are hidden on this page :-( |
Sorry, something went wrong.
|
@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. |
Sorry, something went wrong.
|
Thanks @serhiy-storchaka for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7. |
Sorry, something went wrong.
|
GH-7104 is a backport of this pull request to the 3.7 branch. |
Sorry, something went wrong.
An alternate solution using uuid_enc_be().
https://bugs.python.org/issue32493