Merge lp:~mvo/software-center/lp970627 into lp:software-center/5.2

Proposed by Michael Vogt
Status: Merged
Merged at revision: 3044
Proposed branch: lp:~mvo/software-center/lp970627
Merge into: lp:software-center/5.2
Diff against target: 36 lines (+14/-11)
1 file modified
softwarecenter/expunge.py (+14/-11)
To merge this branch: bzr merge lp:~mvo/software-center/lp970627
Reviewer Review Type Date Requested Status
Gary Lasker (community) Approve
Review via email: mp+108688@code.launchpad.net

This proposal supersedes a proposal from 2012-06-05.

Description of the change

Trivial branch that just catches any IOError in _cleanup_dir(). This shows up on errors.ubuntu.com in the software-center sub page as top 4 (top 3 actually as #2,#3 look like dupes).

To post a comment you must log in.
Revision history for this message
Gary Lasker (gary-lasker) wrote :

Hi Michael, this looks fine. I'll merge to 5.2 now. Many thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/expunge.py'
2--- softwarecenter/expunge.py 2012-03-27 08:57:34 +0000
3+++ softwarecenter/expunge.py 2012-06-05 07:24:20 +0000
4@@ -55,18 +55,21 @@
5 for root, dirs, files in os.walk(path):
6 for f in files:
7 fullpath = os.path.join(root, f)
8- header = open(fullpath).readline().strip()
9- if not header.startswith("status:"):
10- logging.debug(
11- "Skipping files with unknown header: '%s'" % f)
12- continue
13- if self.keep_only_http200 and header != "status: 200":
14- self._rm(fullpath)
15- if self.keep_time:
16- mtime = os.path.getmtime(fullpath)
17- logging.debug("mtime of '%s': '%s" % (f, mtime))
18- if (mtime + self.keep_time) < now:
19+ try:
20+ header = open(fullpath).readline().strip()
21+ if not header.startswith("status:"):
22+ logging.debug(
23+ "Skipping files with unknown header: '%s'" % f)
24+ continue
25+ if self.keep_only_http200 and header != "status: 200":
26 self._rm(fullpath)
27+ if self.keep_time:
28+ mtime = os.path.getmtime(fullpath)
29+ logging.debug("mtime of '%s': '%s" % (f, mtime))
30+ if (mtime + self.keep_time) < now:
31+ self._rm(fullpath)
32+ except IOError as e:
33+ logging.debug("ioerror in cleandir: %s" % e)
34
35 def clean(self):
36 # go over the directories

Subscribers

People subscribed via source and target branches