fix: Initialize is_empty_file

pull/26/head
Raphaël Vinot 2019-08-29 13:04:15 +02:00
parent 697ad80090
commit 8af6f44c49
1 changed files with 2 additions and 0 deletions

View File

@ -194,6 +194,8 @@ class File(FileBase):
expected_mimetypes.append(Config.aliases[expected_mimetype]) expected_mimetypes.append(Config.aliases[expected_mimetype])
if (encoding is None) and (os.path.getsize(self.src_path) == 0): if (encoding is None) and (os.path.getsize(self.src_path) == 0):
is_empty_file = True is_empty_file = True
else:
is_empty_file = False
is_known_extension = self.extension in mimetypes.types_map.keys() is_known_extension = self.extension in mimetypes.types_map.keys()
if is_known_extension and self.mimetype not in expected_mimetypes and not is_empty_file: if is_known_extension and self.mimetype not in expected_mimetypes and not is_empty_file: