summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Gnoutcheff <gnoutchd@softwarefreedom.org>2016-07-14 15:01:38 -0400
committerDaniel Gnoutcheff <gnoutchd@softwarefreedom.org>2016-07-14 15:01:38 -0400
commit3969154e6c497dde2897e9c65a9e1d078c534370 (patch)
tree86891e95690796defce9b9fd5c85f85a2c20b9fd
parent49e9ddf62971fc0073fec428b7b75569e2860cbc (diff)
Minor fixes
- Last bit of status text should got to stderr, too. - Log I/O error instead of crashing.
-rwxr-xr-xsuspicious5
1 files changed, 4 insertions, 1 deletions
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: