]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blobdiff - src/allmydata/immutable/layout.py
immutable: new checker and verifier
[tahoe-lafs/tahoe-lafs.git] / src / allmydata / immutable / layout.py
index 952a6d90d1ae7baadf4c138c27cf54d0698497e4..584dd54a359ac759e9674b45994f5311d277c67b 100644 (file)
@@ -418,7 +418,8 @@ class ReadBucketProxy:
             raise LayoutInvalid("share hash tree corrupted -- should occupy a multiple of %d bytes, not %d bytes" % ((2+HASH_SIZE), size))
         d = self._read(offset, size)
         def _unpack_share_hashes(data):
-            assert len(data) == size
+            if len(data) != size:
+                raise LayoutInvalid("share hash tree corrupted -- got a short read of the share data -- should have gotten %d, not %d bytes" % (size, len(data)))
             hashes = []
             for i in range(0, size, 2+HASH_SIZE):
                 hashnum = struct.unpack(">H", data[i:i+2])[0]