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

Bug #1010411 reported by Natalia
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pkgme
Fix Released
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

Revision history for this message
Natalia (natalia.) wrote :
James Westby (james-w)
Changed in pkgme:
status: New → Triaged
importance: Undecided → High
Jonathan Lange (jml)
Changed in pkgme:
status: Triaged → In Progress
importance: High → Critical
importance: Critical → High
assignee: nobody → Jonathan Lange (jml)
James Westby (james-w)
Changed in pkgme:
status: In Progress → Fix Released
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.