Skip to content

Commit

Permalink
Update files_info reader
Browse files Browse the repository at this point in the history
Re-calculate emptyfiles array after read header.

Signed-off-by: Hiroshi Miura <[email protected]>
  • Loading branch information
miurahr committed Aug 8, 2022
1 parent 241ff93 commit 671ced7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions py7zr/archiveinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,10 @@ def _read(self, fp: BinaryIO):
self._read_start_pos(buffer)
else:
raise Bad7zFile("invalid type %r" % prop) # pragma: no-cover
# re-calculate self.emptyfiles for next append
if numfiles > 0 and len(self.emptyfiles) == 0:
for f in self.files:
self.emptyfiles.append(f.get("emptystream"))

def _read_name(self, buffer: BinaryIO) -> None:
for f in self.files:
Expand Down

0 comments on commit 671ced7

Please sign in to comment.