Commit 96866951 by Michael DeHaan

Assume empty files are unencrypted.

parent 719367fa
...@@ -51,7 +51,11 @@ def is_encrypted(filename): ...@@ -51,7 +51,11 @@ def is_encrypted(filename):
# read first line of the file # read first line of the file
with open(filename) as f: with open(filename) as f:
try:
head = f.next() head = f.next()
except StopIteration:
# empty file, so not encrypted
return False
if head.startswith(HEADER): if head.startswith(HEADER):
return True return True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment