Skip to content

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

Closed

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

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    buildThe build process and cross-build
    3.13only security fixes
    3.14bugs and security fixes
    3.15bugs and security fixes
    3.16new features, bugs and security fixes
    on Jul 21, 2026
  2. added 3 commits that reference this issue on Jul 21, 2026
  3. added a commit that references this issue on Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13only security fixes3.14bugs and security fixes3.15bugs 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

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions