Skip to content

uuid.uuid1() returns a version 4 UUID on OpenBSD #154389

Description

@serhiy-storchaka

Bug report

uuid.uuid1() returns a version 4 UUID on OpenBSD, although it is documented to generate a UUID from a host ID, sequence number and the current time:

>>> import uuid
>>> uuid.uuid1()
UUID('29b977a3-bf64-45d3-b7c2-390c12170eca')
>>> uuid.uuid1().version
4

The _uuid extension implements generate_time_safe() with uuid_create(), and uuid_create(3) on OpenBSD says:

uuid_create() generates version 4 UUIDs, specified by section 4.4 of RFC 4122.

This is the same problem as gh-124228 on NetBSD, which was fixed by not using the library there. FreeBSD and DragonFly BSD provide the same function but generate version 1 UUIDs, so only NetBSD and OpenBSD are affected.

test_uuid fails with 6 failures, AssertionError: 4 != 1.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixes3.14bugs and security fixes3.15pre-release feature fixes, bugs and security fixes3.16new features, bugs and security fixesOS-unsupportedbuildThe build process and cross-buildextension-modulesC modules in the Modules dirtype-bugAn unexpected behavior, bug, or error

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions