Skip to content

Commit 671ced7

Browse files
committed
Update files_info reader
Re-calculate emptyfiles array after read header. Signed-off-by: Hiroshi Miura <miurahr@linux.com>
1 parent 241ff93 commit 671ced7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

py7zr/archiveinfo.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,10 @@ def _read(self, fp: BinaryIO):
751751
self._read_start_pos(buffer)
752752
else:
753753
raise Bad7zFile("invalid type %r" % prop) # pragma: no-cover
754+
# re-calculate self.emptyfiles for next append
755+
if numfiles > 0 and len(self.emptyfiles) == 0:
756+
for f in self.files:
757+
self.emptyfiles.append(f.get("emptystream"))
754758

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

0 commit comments

Comments
 (0)