Skip to content

sysconfig.get_platform() on FreeBSD should not include patch level #159550

Open

Description

@mohd-akram

Bug report

Actual:

$ python3 -c 'import sysconfig; print(sysconfig.get_platform())'
freebsd-15.1-RELEASE-p4-amd64

Expected:

$ python3 -c 'import sysconfig; print(sysconfig.get_platform())'
freebsd-15.1-amd64

See for example the value from config.guess in autoconf:

$ ./config.guess
x86_64-unknown-freebsd15.1

CPython versions tested on:

3.16, 3.14

Operating systems tested on:

Other

Linked PRs

Activity

  1. added
    stdlibStandard Library Python modules in the Lib/ directory
    on Oct 16, 2026
  2. added 2 commits that reference this issue on Oct 16, 2026
  3. gvanrossum commented on Oct 16, 2026

    @gvanrossum
    Member

    @mohd-akram
    Why don't you want it to reveal the patch level? That seems like a potentially useful piece of information (at least for a human).

  4. mohd-akram commented on Oct 16, 2026

    @mohd-akram
    Author

    @gvanrossum This function is used by pip to determine the platform tag. Because it changes with every patch update, the wheels are deemed incompatible even though FreeBSD ABI is stable across patch levels. I noticed this issue because pip kept rebuilding certain Rust packages (which is very slow and resource intensive on a modest server) rather than obtaining them from the cache (because the name in the cache encoded the patch version). Someone had mentioned this issue previously on the FreeBSD mailing list. For humans, it is still available via os.uname() which is the source.

  5. gvanrossum commented on Oct 16, 2026

    @gvanrossum
    Member

    Gotcha! And it looks like pip shouldn't be doing FreeBSD-specific editing of that string, I agree.

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

    OS-freebsdstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions