From: Philipp Gesang Date: Tue, 15 Aug 2017 09:14:01 +0000 (+0200) Subject: clarify index read failure X-Git-Tag: v2.2~7^2~66 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=afc87ebc00bcbc830eb343f53dd3bb507f504c63;p=python-delta-tar clarify index read failure Instead of erroring out with an exception, make --restore emit an error message indicating that something is wrong with the index. --- diff --git a/deltatar/deltatar.py b/deltatar/deltatar.py index 378310a..55a1905 100644 --- a/deltatar/deltatar.py +++ b/deltatar/deltatar.py @@ -1393,8 +1393,13 @@ class DeltaTar(object): index_it = self.iterate_index_path(index1) except tarfile.DecryptionError as exn: self.logger.error("failed to decrypt file [%s]: %s; is this an " - "actual index file?" - % (str(exn), index1)) + "actual encrypted index file?" + % (index1, str (exn))) + return [(index1, exn)] + except Exception as exn: + # compressed files + self.logger.error("failed to read file [%s]: %s; is this an " + "actual index file?" % (index1, str (exn))) return [(index1, exn)] dir_it = self._recursive_walk_dir('.')