mirror of https://github.com/borgbackup/borg.git
check --repair: fix malfunctioning validator, fixes #3444
the major problem was the ('path' in item) expression. the dict has bytes-typed keys there, so it never succeeded as it looked for a str key. this is a 1.1 regression, 1.0 was fine. the dict -> StableDict change is just for being more specific, the check triggered correctly as StableDict subclasses dict, it was just a bit too general.
This commit is contained in:
parent
a68d28bfa4
commit
e09892caec
|
@ -1457,7 +1457,7 @@ class ArchiveChecker:
|
||||||
"""
|
"""
|
||||||
item_keys = frozenset(key.encode() for key in self.manifest.item_keys)
|
item_keys = frozenset(key.encode() for key in self.manifest.item_keys)
|
||||||
required_item_keys = frozenset(key.encode() for key in REQUIRED_ITEM_KEYS)
|
required_item_keys = frozenset(key.encode() for key in REQUIRED_ITEM_KEYS)
|
||||||
unpacker = RobustUnpacker(lambda item: isinstance(item, dict) and 'path' in item,
|
unpacker = RobustUnpacker(lambda item: isinstance(item, StableDict) and b'path' in item,
|
||||||
self.manifest.item_keys)
|
self.manifest.item_keys)
|
||||||
_state = 0
|
_state = 0
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue