Assume empty files are unencrypted.
This commit is contained in:
parent
719367facb
commit
9686695170
1 changed files with 5 additions and 1 deletions
|
@ -51,7 +51,11 @@ def is_encrypted(filename):
|
|||
|
||||
# read first line of the file
|
||||
with open(filename) as f:
|
||||
try:
|
||||
head = f.next()
|
||||
except StopIteration:
|
||||
# empty file, so not encrypted
|
||||
return False
|
||||
|
||||
if head.startswith(HEADER):
|
||||
return True
|
||||
|
|
Loading…
Reference in a new issue