Skip to content

Commit 93a1e06

Browse files
committed
repozo: be more explicit on the FileStorage size retrieval methodology
1 parent c21a6df commit 93a1e06

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/ZODB/scripts/repozo.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,10 @@ def do_incremental_recover(options, repofiles):
760760
datfile = os.path.splitext(repofiles[0])[0] + '.dat'
761761
log('Recovering (incrementally) file to %s', options.output)
762762
with open(options.output, 'r+b') as outfp:
763-
outfp.seek(0, 2)
763+
# Note that we do not open the FileStorage to use getSize here,
764+
# we really want the actual file size, even if there is invalid
765+
# transaction data at the end.
766+
outfp.seek(0, os.SEEK_END)
764767
initial_length = outfp.tell()
765768

766769
error = ''

0 commit comments

Comments
 (0)