diff --git a/warcio/archiveiterator.py b/warcio/archiveiterator.py index 31a69421..eab0846b 100644 --- a/warcio/archiveiterator.py +++ b/warcio/archiveiterator.py @@ -113,7 +113,13 @@ def _iterate_records(self): yield self.record - except EOFError: + except EOFError as e: + if self.reader.decompressor: + if not self.reader.decompressor.eof: + msg = "warning: final record appears to be truncated" + sys.stderr.write(msg + "\n") + raise ArchiveLoadFailed(msg) + empty_record = True self.read_to_end()