question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

linux_distribution() return on CentOS differs from the README

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
terminalmagecommented, Jul 6, 2021

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.

2reactions
jdufresnecommented, Jul 4, 2021

👍 Done in #296.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found