lsb_release crashed with ValueError in <lambda>(): could not convert string to float: '6.06 LTS'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lsb (Ubuntu) |
Fix Released
|
Medium
|
Ioanna Alifieraki | ||
Bionic |
Confirmed
|
Undecided
|
Ioanna Alifieraki | ||
Focal |
Confirmed
|
Undecided
|
Ioanna Alifieraki | ||
Jammy |
Confirmed
|
Undecided
|
Ioanna Alifieraki |
Bug Description
[Description]
In some cases lsb_release script can crash with the following trace :
Traceback (most recent call last):
File "/usr/bin/
main()
File "/usr/bin/
distinfo = lsb_release.
File "/usr/lib/
get_distro_
distinfo = guess_debian_
File "/usr/lib/
guess_debian_
get_distro_
File "/usr/lib/
get_distro_info
RELEASES_
File "/usr/lib/
RELEASES_
ValueError: could not convert string to float: '6.06 LTS
The root cause of this is that function get_distro_info() while parsing
the '/usr/share/
beginning of each line, instead it find a string ("6.06 LTS").
There is a fix for this bug upstream:
https:/
and is already in kinetic.
[Test Case]
The easier way to reproduce this bug is to hack /usr/share/
change the get_distro_info definition from
def get_distro_
to
def get_distro_
and run
$ lsb_release
Traceback (most recent call last):
File "/usr/bin/
import lsb_release
File "/usr/lib/
get_
File "/usr/lib/
RELEASES_
File "/usr/lib/
RELEASES_
ValueError: could not convert string to float: '6.06 LTS'
A detailed analysis on how this bug can happen in a real life scenario
can be found in comment #3.
[Regression Potential]
The fix changes the way get_distro_info function parses the csv file and instead of expecting
a float at the beginning of the line, it now expects a string and isolates the numerical part.
The regression potential is small and would affect the behavior of lsb_release executable.
[Other]
Debian bug : https:/
Fix : https:/
Affected releases : Jammy, Focal, Bionic
tags: | removed: need-duplicate-check |
Changed in lsb (Ubuntu): | |
importance: | Undecided → Medium |
@lan1967 Is there any reason for this bug to be private ?