This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Michael.Felt
Recipients David Carlier, Michael.Felt, devnexen, koobs, pitrou, vstinner
Date 2018-01-22.23:41:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <e2c0c9c9-a210-1879-cf45-484a04618dac@felt.demon.nl>
In-reply-to <1516184213.8.0.467229070634.issue32493@psf.upfronthosting.co.za>
Content
On 1/17/2018 11:16 AM, David CARLIER wrote:
> David CARLIER <devnexen@gmail.com> added the comment:
>
> Might comes from uuid1 function itself ... e.g. line 704 not setting version "field".
IMHO: for uuid1 - the version number should be in the 16 bytes filled by 
uuid_create. The implementation of uuid4() in uuid.py "has to" specify 
the attribute by setting the UUID version attribute to 4, so that when 
an uuid4 instance gets asked it's version it says 4. A random number 
gives no such guarantee.

Taking a hint from the FreeBSD man page for uuid_create() - that says it 
provides a DCE 1.1 RPC implementation - I found this link:
http://pubs.opengroup.org/onlinepubs/9629399/apdxa.htm

Therein:

The timestamp is a 60 bit value. For UUID version 1, this is represented 
by Coordinated Universal Time (UTC) as a count of 100-nanosecond 
intervals since 00:00:00.00, 15 October 1582 (the date of Gregorian 
reform to the Christian calendar).

The version number is multiplexed in the 4 most significant bits of the 
*time_hi_and_version* field. UUID version Field 
<http://pubs.opengroup.org/onlinepubs/9629399/apdxa.htm#tagtcjh_35> 
lists currently defined versions of the UUID.

Again - a random number is not likely to correctly set the 4 most significant bits - so another way is needed to make an instance it is version 4.
IMHO - the output of uuid_create should satisfy the needs of uuid version 1.

>
> ----------
> nosy: +David CARLIER2
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue32493>
> _______________________________________
>
History
Date User Action Args
2018-01-22 23:41:55Michael.Feltsetrecipients: + pitrou, vstinner, koobs, David Carlier, devnexen
2018-01-22 23:41:55Michael.Feltlinkissue32493 messages
2018-01-22 23:41:55Michael.Feltcreate