From 53b14bdf2bc0b64b6820f1861a97108e7d40ce6e Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 3 Jan 2008 00:25:00 -0800 Subject: [PATCH] Handle errors hashing files that vanish. --- assurance/main.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/assurance/main.py b/assurance/main.py index fc2d820..6494dcf 100644 --- a/assurance/main.py +++ b/assurance/main.py @@ -422,14 +422,20 @@ class update_comparer(comparer): if same_inode(a[2], b[2]): b[2]['md5'] = a[2]['md5'] else: - b[2]['md5'] = hashing.hashof(os.path.join(path, b[1])) + try: + b[2]['md5'] = hashing.hashof(os.path.join(path, b[1])) + except OSError: + b[2]['md5'] = '[error]' yield b return def handle_add_nondir(self, path, a, recursing): update_link(a[2], path, a[1]) if a[2]['kind'] == 'file': - a[2]['md5'] = hashing.hashof(os.path.join(path, a[1])) + try: + a[2]['md5'] = hashing.hashof(os.path.join(path, a[1])) + except OSError: + a[2]['md5'] = '[error]' yield a return -- 2.11.4.GIT