dongzhaorui %!s(int64=3) %!d(string=hai) anos
pai
achega
e118240f9f
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      zbytb/utils/clean_file.py

+ 4 - 2
zbytb/utils/clean_file.py

@@ -69,8 +69,10 @@ def discern_file_format(text):
             if result is not None:
                 return t
     else:
-        unknown_type = re.findall('[^.\\/:*?"<>|\r\n]+$', text, re.S)
-        logger.warning(f'[附件类型识别]未定义的文件类型{unknown_type}')
+        # unknown_type = re.findall('[^.\\/:*?"<>|\r\n]+$', text, re.S)
+        non_type = re.search('([.][a-zA-Z]{3,5})$', text)
+        if non_type is not None:
+            logger.warning(f'[未知附件类型]{non_type.group()}')
         return None