Skip to content

linux_distribution() return on CentOS differs from the README #263

@terminalmage

Description

@terminalmage

From the README

>>> import distro
>>> distro.linux_distribution(full_distribution_name=False)
('centos', '7.1.1503', 'Core')

Actual behavior

>>> import distro
>>> distro.linux_distribution(full_distribution_name=False)
('centos', '7', 'Core')

The same goes for CentOS 8:

>>> import distro
>>> distro.linux_distribution(full_distribution_name=False)
('centos', '8', 'Core')

Possible solutions

  1. Use best=True when getting the version in linux_distribution()
  2. Add a best_version argument to linux_distribution() to allow this to be passed through.

I do think that adding a best_version argument would be a good idea. However, I'm not sure defaulting to best=True helps, since it adds the maintenance releases to Ubuntu LTS releases.

So, perhaps this current behavior is best, since it makes the behavior of linux_distribution more congruent with other Linux distros. If that is indeed the position of the project maintainers, and no changes need to be made to the code, I can open a PR to update the README.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions