Revert change to magic.from_file

pull/21/head
Dan Puttick 2017-07-20 15:40:49 -04:00
parent c3fed019ab
commit 92d77e1a82
1 changed files with 2 additions and 3 deletions

View File

@ -240,11 +240,10 @@ class FileBase(object):
self.set_property('symlink_path', os.readlink(file_path))
else:
try:
with open(file_path, 'rb') as file:
mt = magic.from_buffer(file, mime=True)
mt = magic.from_file(file_path, mime=True)
# libmagic will always return something, even if it's just 'data'
except UnicodeEncodeError as e:
raise UnicodeEncodeError(e)
raise UnicodeEncodeError
self.add_error(e, '')
mt = None
try: