diff --git a/pym/cl_utils.py b/pym/cl_utils.py index cd2acc5..5c6a199 100644 --- a/pym/cl_utils.py +++ b/pym/cl_utils.py @@ -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()