Explorar o código

Add missing error handler in directory attr restore loop (1/2)

Marian Beermann %!s(int64=9) %!d(string=hai) anos
pai
achega
e365d64718
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      borg/archiver.py

+ 5 - 1
borg/archiver.py

@@ -389,7 +389,11 @@ class Archiver:
 
         if not args.dry_run:
             while dirs:
-                archive.extract_item(dirs.pop(-1))
+                dir_item = dirs.pop(-1)
+                try:
+                    archive.extract_item(dir_item)
+                except BackupOSError as e:
+                    self.print_warning('%s: %s', remove_surrogates(dir_item[b'path']), e)
         for pattern in include_patterns:
             if pattern.match_count == 0:
                 self.print_warning("Include pattern '%s' never matched.", pattern)