linux_distribution() return on CentOS differs from the README
See original GitHub issueFrom 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
- Use
best=True
when getting the version inlinux_distribution()
- Add a
best_version
argument tolinux_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.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:15 (5 by maintainers)
Top Results From Across the Web
Everything You Want to Know About CentOS as ... - Linux Hint
In the hosting market, CentOS is considered the most reliable distribution. CentOS is exceptionally compatible with most Linux software because ...
Read more >How to distinguish between different operating system distros ...
The linux_distribution() function in Python's platform module should work with most of the more common and many of the less common Linux distributions:...
Read more >How is CentOS different from Debian? - Packagecloud Blog
The differences between CentOS and Debian described in this article will help you to make the right choice of Linux distribution.
Read more >nvm-sh/nvm: Node Version Manager - POSIX-compliant bash ...
nvm allows you to quickly install and use different versions of node via the ... On Linux, after running the install script, if...
Read more >RPM Packaging Guide
RPM makes it easier for you to distribute, manage, and update software that you create for Red Hat Enterprise Linux, CentOS, and Fedora....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There should also be changes to the README.md. The example usage of
linux_distribution
should be corrected to match the actual output. In addition, if the code is being deprecated, the README should state this. And if there is recommended usage, that recommended usage should be in the README. Seems a bit nonsensical to have the documentation show only deprecated usage, IMO.👍 Done in #296.