Merge lp:~laney/software-center/lp1526450 into lp:software-center

Proposed by Iain Lane
Status: Merged
Approved by: dobey
Approved revision: 3327
Merged at revision: 3335
Proposed branch: lp:~laney/software-center/lp1526450
Merge into: lp:software-center
Prerequisite: lp:~barry/software-center/lp1526450
Diff against target: 12 lines (+1/-1)
1 file modified
softwarecenter/db/update.py (+1/-1)
To merge this branch: bzr merge lp:~laney/software-center/lp1526450
Reviewer Review Type Date Requested Status
dobey Approve
Barry Warsaw Approve
Review via email: mp+280698@code.launchpad.net

Commit message

Open cataloged_times.p as bytes for py3 compatibility

Description of the change

Need to open the catalog file as bytes explicitly for python3 compatiblity, otherwise you get "failed to load file /var/lib/apt-xapian-index/cataloged_times.p: a bytes-like object is required, not 'str'"

To post a comment you must log in.
Revision history for this message
Barry Warsaw (barry) wrote :

+1

review: Approve
Revision history for this message
dobey (dobey) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/db/update.py'
2--- softwarecenter/db/update.py 2015-12-16 11:08:41 +0000
3+++ softwarecenter/db/update.py 2015-12-16 11:08:41 +0000
4@@ -110,7 +110,7 @@
5 CF = "/var/lib/apt-xapian-index/cataloged_times.p"
6 if os.path.exists(CF):
7 try:
8- cataloged_times = pickle.load(open(CF))
9+ cataloged_times = pickle.load(open(CF, 'rb'))
10 except Exception as e:
11 LOG.warn("failed to load file %s: %s", CF, e)
12 del CF