projects
/
tahoe-lafs
/
tahoe-lafs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
46fe024
)
encode.py: improve error message when segment lengths come out wrong
author
Brian Warner
<warner@allmydata.com>
Fri, 25 Jan 2008 04:51:09 +0000
(21:51 -0700)
committer
Brian Warner
<warner@allmydata.com>
Fri, 25 Jan 2008 04:51:09 +0000
(21:51 -0700)
src/allmydata/encode.py
patch
|
blob
|
history
diff --git
a/src/allmydata/encode.py
b/src/allmydata/encode.py
index 1615b00f9fccea943a735347906cbab9c6e80bd3..0815df937bba290dc2c49fdc76c3d4b8d729dd1f 100644
(file)
--- a/
src/allmydata/encode.py
+++ b/
src/allmydata/encode.py
@@
-352,7
+352,11
@@
class Encoder(object):
encrypted_pieces.append('\x00' * pad_size)
else:
# 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)
return previous_chunks + [encrypted_piece]