|
|
|
@ -124,7 +124,13 @@ class typeFile:
|
|
|
|
|
|
|
|
|
|
def getMType(self, filename):
|
|
|
|
|
"""Информация о типе файла"""
|
|
|
|
|
ret = self.magicObject.file(filename)
|
|
|
|
|
try:
|
|
|
|
|
ret = self.magicObject.file(filename)
|
|
|
|
|
except UnicodeDecodeError:
|
|
|
|
|
try:
|
|
|
|
|
ret = self.magicObject.file(filename.decode('utf-8'))
|
|
|
|
|
except UnicodeDecodeError:
|
|
|
|
|
return None
|
|
|
|
|
# fix for kernel 3.7.7 (bad work samba with big files)
|
|
|
|
|
if ret is None and self.magicObject.errno() == 5:
|
|
|
|
|
r,w = os.pipe()
|
|
|
|
|