Merge lp:~gary-lasker/software-center/for-3.0-osomon-fix-lp725186 into lp:software-center/3.0

Proposed by Gary Lasker
Status: Merged
Merged at revision: 1124
Proposed branch: lp:~gary-lasker/software-center/for-3.0-osomon-fix-lp725186
Merge into: lp:software-center/3.0
Diff against target: 73 lines (+31/-17)
2 files modified
debian/changelog (+8/-0)
softwarecenter/apt/apthistory.py (+23/-17)
To merge this branch: bzr merge lp:~gary-lasker/software-center/for-3.0-osomon-fix-lp725186
Reviewer Review Type Date Requested Status
software-store-developers Pending
Review via email: mp+51997@code.launchpad.net

Description of the change

This is a backport to maverick from Olivier Tilloy of his fix for bug 725186. We should consider this for an SRU. Please see the bug for details.

Thanks!

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2011-02-10 08:25:06 +0000
+++ debian/changelog 2011-03-03 02:13:01 +0000
@@ -1,3 +1,11 @@
1software-center (3.0.9) UNRELEASED; urgency=low
2
3 [ Olivier Tilloy ]
4 * softwarecenter/apt/apthistory.py:
5 - fix startup crash if the history file is corrupted (LP: #725186)
6
7 -- Gary Lasker <gary.lasker@canonical.com> Mon, 28 Feb 2011 16:20:50 -0500
8
1software-center (3.0.8) maverick-proposed; urgency=low9software-center (3.0.8) maverick-proposed; urgency=low
210
3 [ Gary Lasker ]11 [ Gary Lasker ]
412
=== modified file 'softwarecenter/apt/apthistory.py'
--- softwarecenter/apt/apthistory.py 2010-09-16 09:50:32 +0000
+++ softwarecenter/apt/apthistory.py 2011-03-03 02:13:01 +0000
@@ -27,6 +27,7 @@
27import logging27import logging
28import string28import string
29import datetime29import datetime
30import zlib
3031
3132
32from datetime import datetime33from datetime import datetime
@@ -107,23 +108,28 @@
107 except IOError, ioe:108 except IOError, ioe:
108 LOG.debug(ioe)109 LOG.debug(ioe)
109 return110 return
110 for stanza in deb822.Deb822.iter_paragraphs(f):111 try:
111 # keep the UI alive112 for stanza in deb822.Deb822.iter_paragraphs(f):
112 while self.main_context.pending():113 # keep the UI alive
113 self.main_context.iteration()114 while self.main_context.pending():
114 # ignore records with 115 self.main_context.iteration()
115 try:116 # ignore records with
116 trans = Transaction(stanza)117 try:
117 except KeyError, e:118 trans = Transaction(stanza)
118 continue119 except KeyError, e:
119 # ignore the ones we have already120 continue
120 if (rescan and121 # ignore the ones we have already
121 len(self.transactions) > 0 and122 if (rescan and
122 trans.start_date < self.transactions[0].start_date):123 len(self.transactions) > 0 and
123 break124 trans.start_date < self.transactions[0].start_date):
124 # add it125 break
125 self.transactions.insert(0, trans)126 # add it
126 127 self.transactions.insert(0, trans)
128 except zlib.error, ze:
129 # corrupted history file, skip it
130 # (see http://bugs.launchpad.net/bugs/725186)
131 LOG.debug(ze)
132
127 def _on_apt_history_changed(self, monitor, afile, other_file, event):133 def _on_apt_history_changed(self, monitor, afile, other_file, event):
128 if event == gio.FILE_MONITOR_EVENT_CHANGES_DONE_HINT:134 if event == gio.FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
129 self._scan(self.history_file, rescan = True)135 self._scan(self.history_file, rescan = True)

Subscribers

People subscribed via source and target branches