From 3969154e6c497dde2897e9c65a9e1d078c534370 Mon Sep 17 00:00:00 2001 From: Daniel Gnoutcheff Date: Thu, 14 Jul 2016 15:01:38 -0400 Subject: Minor fixes - Last bit of status text should got to stderr, too. - Log I/O error instead of crashing. --- suspicious | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/suspicious b/suspicious index dedf43f..178ae4b 100755 --- a/suspicious +++ b/suspicious @@ -323,6 +323,9 @@ for file in filelist: except UnicodeDecodeError: print("possible binary: " + file) continue + except OSError: + print("read error: " + file) + continue datasize += len(filecontents) filenamescore = scoretext(wordlist, file, options.maxwholewordlength) filecontentsscore = scoretext(wordlist, filecontents, options.maxwholewordlength) @@ -332,7 +335,7 @@ for file in filelist: #Clear screen of proggress text now that finished scoring file if options.display_progress: - print('\r' + " " * len(progresstext) + '\r', end='') + print('\r' + " " * len(progresstext) + '\r', end='', file=sys.stderr) #Save summary as a file, but if the filename exists do not overwrite, append a number if options.summaryfile and len(filelist) > 0 and not options.displaysummary: -- cgit v1.2.1