Skip to content

Commit 0cfdf6d

Browse files
zlib legacy decompress: return meta dict, fixes #7883
for the other compression methods, this is done in the base class, but the zlib legacy does not call that method as it also removes the header bytes, which zlib legacy does not have.
1 parent e1c75e8 commit 0cfdf6d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/borg/compress.pyx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,12 @@ class ZLIB_legacy(CompressorBase):
438438

439439
def decompress(self, meta, data):
440440
# note: for compatibility no super call, do not strip ID bytes
441+
assert self.legacy_mode # only borg 1.x repos have the legacy ZLIB format
442+
assert meta is None
443+
meta = {}
444+
meta["ctype"] = ZLIB.ID # change to non-legacy ZLIB id
445+
meta["clevel"] = 255 # we do not know the compression level
446+
meta["csize"] = len(data)
441447
try:
442448
return meta, zlib.decompress(data)
443449
except zlib.error as e:

0 commit comments

Comments
 (0)