Merge lp:~brian-murray/apport/bug-1097773 into lp:~apport-hackers/apport/trunk

Proposed by Brian Murray
Status: Merged
Merged at revision: 2687
Proposed branch: lp:~brian-murray/apport/bug-1097773
Merge into: lp:~apport-hackers/apport/trunk
Diff against target: 30 lines (+9/-1)
2 files modified
NEWS (+3/-0)
apport/report.py (+6/-1)
To merge this branch: bzr merge lp:~brian-murray/apport/bug-1097773
Reviewer Review Type Date Requested Status
Martin Pitt (community) Approve
Review via email: mp+180615@code.launchpad.net

Description of the change

Evan had a branch fixing this but a merge proposal was not submitted, I'm just doing that for him. This error is occurring rather regularly in 13.04 - https://errors.ubuntu.com/bucket/?id=/usr/share/apport/apport-gtk:ValueError:__getitem__:__getitem__:_apt_pkg:__getitem__:%3Clambda%3E:%3Clambda%3E:collect_info:exc_raise:run:thread_collect_info:add_package_info:get_source:_apt_pkg. I'll SRU the fix if it is accepted.

To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

Note that ui.py info collection marks a report as unreportable if the SourcePackage field is missing. Also, add_package_info()'s documentation currently says that this field will be added. If we cannot rely on that any more, we need to adjust these.

I went through the other usages of SourcePackage in the apport code, and they are all properly conditionalized.

Revision history for this message
Martin Pitt (pitti) wrote :

This needed some further adjustments in the tests, and aforementioned changes. Merged now, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS'
2--- NEWS 2013-08-02 14:02:44 +0000
3+++ NEWS 2013-08-16 16:41:53 +0000
4@@ -9,6 +9,9 @@
5 don't have Contents.gz).
6 * Robustify "progress bar visible" GTK and KDE UI checks for the faster
7 collection due to dropping lsb_release.
8+ * apport/report.py: Gracefully handle being unable to get the source package
9+ for a binary package, as when the latter does not exist in the cache.
10+ (LP: #1097773)
11
12 2.12 (2013-08-02)
13 -----------------
14
15=== modified file 'apport/report.py'
16--- apport/report.py 2013-08-02 09:08:44 +0000
17+++ apport/report.py 2013-08-16 16:41:53 +0000
18@@ -289,7 +289,12 @@
19 self['Package'] = '%s %s%s' % (package, version or '(not installed)',
20 self._customized_package_suffix(package))
21 if version or 'SourcePackage' not in self:
22- self['SourcePackage'] = packaging.get_source(package)
23+ try:
24+ self['SourcePackage'] = packaging.get_source(package)
25+ except ValueError:
26+ # The package may not exist in the cache, as is the case with
27+ # skype-bin.
28+ pass
29 if not version:
30 return
31

Subscribers

People subscribed via source and target branches