guard call to stat() against ENOENT
[python-delta-tar] / deltatar / deltatar.py
index 161008c..03de734 100644 (file)
@@ -733,14 +733,14 @@ class DeltaTar(object):
 
         # for each file to be in the backup, do:
         for path in self._recursive_walk_dir('.'):
-            # calculate stat dict for current file
-            statd = self._stat_dict(path)
-            statd['path'] = u'snapshot://' + statd['path']
-            statd['volume'] = self.vol_no
-
-            # backup file
 
             try: # backup file
+                # calculate stat dict for current file
+                statd = self._stat_dict(path)
+                statd['path'] = u'snapshot://' + statd['path']
+                statd['volume'] = self.vol_no
+
+                # backup file
                 tarobj.add(path, arcname = statd['path'], recursive=False)
             except FileNotFoundError as exn:
                 # file vanished since the call to access(3) above