pkgme.info_elements.Distribution.get_default fails if /etc/lsb-release is missing

Bug #1010411 reported by Natalia on 2012-06-08
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pkgme
High
Jonathan Lange

Bug Description

| In [1]: from pkgme.info_elements import Distribution
| In [2]: e = Distribution()
| In [3]: e.get_default()
| ---------------------------------------------------------------------------
| IOError Traceback (most recent call last)
|
| /tmp/pkgme/<ipython console> in <module>()
|
| /tmp/pkgme/pkgme/info_elements.py in get_default(cls)
| 148 @classmethod
| 149 def get_default(cls):
| --> 150 with open('/etc/lsb-release') as fp:
| 151 release_keys = dict(
| 152 line.strip().split('=') for line in fp.readlines())
|
| IOError: [Errno 2] No such file or directory: '/etc/lsb-release'

pkgme fails on Debian Sid due to missing /etc/lsb-release file, attached patch
fixes it (it returns UNRELEASED if the file is missing)

Related branches

Natalia (natalia.) wrote :
James Westby (james-w) on 2012-09-21
Changed in pkgme:
status: New → Triaged
importance: Undecided → High
Jonathan Lange (jml) on 2012-09-21
Changed in pkgme:
status: Triaged → In Progress
importance: High → Critical
importance: Critical → High
assignee: nobody → Jonathan Lange (jml)
James Westby (james-w) on 2012-09-27
Changed in pkgme:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers