Selaa lähdekoodia

implement cmdline metadata value decoding

code copied & adapted from Archive.load()
Thomas Waldmann 9 vuotta sitten
vanhempi
sitoutus
7d31da7914
1 muutettua tiedostoa jossa 2 lisäystä ja 1 poistoa
  1. 2 1
      borg/archive.py

+ 2 - 1
borg/archive.py

@@ -820,7 +820,8 @@ class ArchiveChecker:
             archive = StableDict(msgpack.unpackb(data))
             if archive[b'version'] != 1:
                 raise Exception('Unknown archive metadata version')
-            decode_dict(archive, (b'name', b'hostname', b'username', b'time'))  # fixme: argv
+            decode_dict(archive, (b'name', b'hostname', b'username', b'time'))
+            archive[b'cmdline'] = [arg.decode('utf-8', 'surrogateescape') for arg in archive[b'cmdline']]
             items_buffer = ChunkBuffer(self.key)
             items_buffer.write_chunk = add_callback
             for item in robust_iterator(archive):