distro-info from pypi doesn't work because /usr/share/distro-info/ubuntu.csv is not included

Bug #1990666 reported by Thomas Bechtold
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
distro-info (Ubuntu)
New
Undecided
Unassigned

Bug Description

If you install distro-info from pypi and don't have /usr/share/distro-info/ubuntu.csv installed from your local package manager the pypi package is useless because it fails with:

Python 3.10.7 (main, Sep 8 2022, 14:34:29) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from distro_info import UbuntuDistroInfo
>>> UbuntuDistroInfo()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/tom/tmp/v3/lib/python3.10/site-packages/distro_info.py", line 319, in __init__
    super().__init__("Ubuntu")
  File "/home/tom/tmp/v3/lib/python3.10/site-packages/distro_info.py", line 109, in __init__
    csvfile = open(filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/share/distro-info/ubuntu.csv'

I'm not sure if this is the correct place to report this bug but https://salsa.debian.org/debian/distro-info/-/tree/master/ doesn't have issues enabled and there is no README...

ProblemType: Bug
DistroRelease: Ubuntu 22.10
Package: distro-info 1.1build1
ProcVersionSignature: Ubuntu 5.19.0-15.15-generic 5.19.0
Uname: Linux 5.19.0-15-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.23.0-0ubuntu2
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Fri Sep 23 15:44:44 2022
InstallationDate: Installed on 2022-03-21 (185 days ago)
InstallationMedia: Ubuntu 21.10 "Impish Indri" - Release amd64 (20211012)
SourcePackage: distro-info
UpgradeStatus: Upgraded to kinetic on 2022-09-18 (4 days ago)

Revision history for this message
Thomas Bechtold (toabctl) wrote :
Revision history for this message
Thomas Bechtold (toabctl) wrote :

Please either fix the version on pypi (include the file and search for it in the python code) or drop the version from pypi to not confuse people.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.