mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-19 13:07:56 +00:00
storageserver: the last segment is not always going to be the same size as the rest, so don't assert such a thing
This commit is contained in:
parent
2e15c9aed2
commit
dbbbc96cbf
@ -38,7 +38,10 @@ class BucketWriter(Referenceable):
|
||||
|
||||
def remote_put_block(self, segmentnum, data):
|
||||
precondition(not self.closed)
|
||||
assert len(data) == self.blocksize
|
||||
# all blocks but the last will be of size self.blocksize, however the
|
||||
# last one may be short, and we don't know the total number of
|
||||
# segments so we can't tell which is which.
|
||||
assert len(data) <= self.blocksize
|
||||
f = open(os.path.join(self.incominghome, 'data'), 'wb')
|
||||
f.seek(self.blocksize*segmentnum)
|
||||
f.write(data)
|
||||
|
Loading…
Reference in New Issue
Block a user