1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-27 10:18:12 +00:00

check: do not stumble over invalid item key, fixes #4845

The code used for error reporting crashes due to an invalid utf-8
sequence. Use errors='replace' to never crash there. Errors
are expected in input data when borg check is run.
This commit is contained in:
Thomas Waldmann 2019-11-19 20:43:32 +01:00
parent 0b8c9b236e
commit 046dea8643

View file

@ -1726,7 +1726,7 @@ def report(msg, chunk_id, chunk_no):
logger.error(msg) logger.error(msg)
def list_keys_safe(keys): def list_keys_safe(keys):
return ', '.join((k.decode() if isinstance(k, bytes) else str(k) for k in keys)) return ', '.join((k.decode(errors='replace') if isinstance(k, bytes) else str(k) for k in keys))
def valid_item(obj): def valid_item(obj):
if not isinstance(obj, StableDict): if not isinstance(obj, StableDict):