encode.py: improve error message when segment lengths come out wrong
This commit is contained in:
parent
46fe024612
commit
081d27a65d
|
@ -352,7 +352,11 @@ class Encoder(object):
|
||||||
encrypted_pieces.append('\x00' * pad_size)
|
encrypted_pieces.append('\x00' * pad_size)
|
||||||
else:
|
else:
|
||||||
# non-tail segments should be the full segment size
|
# non-tail segments should be the full segment size
|
||||||
assert length == input_chunk_size
|
log.msg("non-tail segment should be full segment size: %d!=%d"
|
||||||
|
% (length, input_chunk_size), level=log.BAD)
|
||||||
|
precondition(length == input_chunk_size,
|
||||||
|
"length=%d != input_chunk_size=%d" %
|
||||||
|
(length, input_chunk_size))
|
||||||
|
|
||||||
encrypted_piece = "".join(encrypted_pieces)
|
encrypted_piece = "".join(encrypted_pieces)
|
||||||
return previous_chunks + [encrypted_piece]
|
return previous_chunks + [encrypted_piece]
|
||||||
|
|
Loading…
Reference in New Issue