Explorar el Código

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

Marian Beermann hace 9 años
padre
commit
26bf500566
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      borg/archiver.py

+ 5 - 1
borg/archiver.py

@@ -372,7 +372,11 @@ class Archiver:
                     continue
                     continue
             if not args.dry_run:
             if not args.dry_run:
                 while dirs and not item[b'path'].startswith(dirs[-1][b'path']):
                 while dirs and not item[b'path'].startswith(dirs[-1][b'path']):
-                    archive.extract_item(dirs.pop(-1), stdout=stdout)
+                    dir_item = dirs.pop(-1)
+                    try:
+                        archive.extract_item(dir_item, stdout=stdout)
+                    except BackupOSError as e:
+                        self.print_warning('%s: %s', remove_surrogates(dir_item[b'path']), e)
             if output_list:
             if output_list:
                 logger.info(remove_surrogates(orig_path))
                 logger.info(remove_surrogates(orig_path))
             try:
             try: