Skip to content

Make 'sys.platform' return "freebsd" only on FreeBSD without major version #129393

@michael-o

Description

@michael-o

Feature or enhancement

Proposal:

When using using sys.platform and especially requirements.txt /pyproject.toml one cannot constrain dependencies to FreeBSD as whole, but need to deal with the suffixed major version. A change should follow suit all other cases to contain the platform name only without the major version.

Locally patched:

osipovmi@deblndw011x:~/var/Projekte/cpython (main *+>)
$ /tmp/python-3.13/bin/python3
Python 3.14.0a4+ (heads/main-dirty:8e57877e3f4, Jan 28 2025, 10:01:48) [Clang 19.1.5 (https://github.com/llvm/llvm-project.git llvmorg-19.1.5-0-gab4b5a on freebsd
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.platform
'freebsd'
>>>

A PR wll follow soon.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions