Merge lp:~tycho-s/simplestreams/fix-1237990 into lp:~smoser/simplestreams/trunk

Proposed by Tycho Andersen
Status: Merged
Merged at revision: 316
Proposed branch: lp:~tycho-s/simplestreams/fix-1237990
Merge into: lp:~smoser/simplestreams/trunk
Diff against target: 18 lines (+7/-1)
1 file modified
simplestreams/objectstores/__init__.py (+7/-1)
To merge this branch: bzr merge lp:~tycho-s/simplestreams/fix-1237990
Reviewer Review Type Date Requested Status
Scott Moser Pending
Review via email: mp+190387@code.launchpad.net
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
1=== modified file 'simplestreams/objectstores/__init__.py'
2--- simplestreams/objectstores/__init__.py 2013-09-11 21:22:41 +0000
3+++ simplestreams/objectstores/__init__.py 2013-10-10 15:00:45 +0000
4@@ -106,7 +106,13 @@
5 # continuing not supported, just delete and retry
6 os.unlink(partfile)
7
8- with open(partfile, "ab") as wfp:
9+ with open(partfile, "r+b") as wfp:
10+ # read the first part of the file in to get the right checksum
11+ while True:
12+ buf = wfp.read(self.read_size)
13+ cksum.update(buf)
14+ if len(buf) < self.read_size:
15+ break
16
17 while True:
18 buf = reader.read(self.read_size)

Subscribers

People subscribed via source and target branches

to all changes: