Commit 9730e234 authored by Dionysis Zindros's avatar Dionysis Zindros
Browse files

Explicit error message for offset/size mismatch.

To assist porting to Windows, offset/size mismatch when reading files is now
being clearly reported with detailed error messages.
parent 746f8419
......@@ -243,7 +243,12 @@ class PithosClient(PithosRestAPI):
offset += bytes
if hash_cb:
hash_gen.next()
assert offset == size
if offset != size:
print("Size is %i" % size)
print("Offset is %i" % offset)
assert offset == size, \
"Failed to calculate uploaded blocks: " \
"Offset and object size do not match"
def _upload_missing_blocks(self, missing, hmap, fileobj, upload_cb=None):
"""upload missing blocks asynchronously.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment