python-distro / distro

A much more elaborate replacement for removed Python's `platform.linux_distribution()` method
https://distro.readthedocs.io/
Apache License 2.0
265 stars 65 forks source link

`minor_version()` returns and empty string on Debian 10 Buster #345

Closed brendan-simon-indt closed 2 years ago

brendan-simon-indt commented 2 years ago

The minor_version() returns an empty string ('') on Debian 10 Buster (amd64 and armhf).

The platform module reports 10.12 for the version, but the distro equivalent does not. I consider this a bug.

# cat /etc/debian_version
10.12

In this case, distro.minor_version() should return '12', and distro.version(), distro.version_parts() should return the minor version number accordingly.

Similarly distro.build_number() also returns ''. This may or may not be correct, but might also be a bug if falling foul of the same bug as minor_version().

>>> import platform as p
>>> import distro as d

>>> d.__version__
'1.7.0'

>>> p.linux_distribution()
('debian', '10.12', '')

>>> d.linux_distribution( full_distribution_name=False )
('debian', '10', 'buster')

>>> d.version()
'10'

>>> d.major_version()
'10'

>>> d.minor_version()
''

>>> d.build_number()
''
HorlogeSkynet commented 2 years ago

Hi @brendan-simon-indt, please see #332 and #333, this should be fixed in the next distro release.