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.
This commit is contained in:
Thomas Waldmann 2023-10-24 19:37:24 +02:00
parent e1c75e8542
commit 0cfdf6da91
No known key found for this signature in database
GPG Key ID: 243ACFA951F78E01
1 changed files with 6 additions and 0 deletions

View File

@ -438,6 +438,12 @@ class ZLIB_legacy(CompressorBase):
def decompress(self, meta, data):
# note: for compatibility no super call, do not strip ID bytes
assert self.legacy_mode # only borg 1.x repos have the legacy ZLIB format
assert meta is None
meta = {}
meta["ctype"] = ZLIB.ID # change to non-legacy ZLIB id
meta["clevel"] = 255 # we do not know the compression level
meta["csize"] = len(data)
try:
return meta, zlib.decompress(data)
except zlib.error as e: