From 313347dd619a7f615dbe306725872a212881b54b Mon Sep 17 00:00:00 2001 From: Peter Hofmann Date: Wed, 21 Sep 2016 17:40:42 +0200 Subject: [PATCH] Show warnings about unreadable files even with verbosity == 0 I had a semi-corrupt encfs (which I detected, thanks to this tool!). A file was only partially readable. Somewhere in the middle, an IOError occured. Essentially, this is a corrupt file system -- which this tool is meant to help detect --, so this class of errors shouldn't be suppressed by "-q". --- src/bitrot.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/bitrot.py b/src/bitrot.py index 8c7305e..669fd4a 100644 --- a/src/bitrot.py +++ b/src/bitrot.py @@ -221,13 +221,12 @@ class Bitrot(object): try: new_sha1 = sha1(p, self.chunk_size) except (IOError, OSError) as e: - if self.verbosity: - print( - '\rwarning: cannot compute hash of {} [{}]'.format( - p, errno.errorcode[e.args[0]], - ), - file=sys.stderr, - ) + print( + '\rwarning: cannot compute hash of {} [{}]'.format( + p, errno.errorcode[e.args[0]], + ), + file=sys.stderr, + ) continue cur.execute('SELECT mtime, hash, timestamp FROM bitrot WHERE '