From 0109eb570322fe0be3ff671e3ea3f99cfba2ea80 Mon Sep 17 00:00:00 2001 From: marques <20172333133@m.scnu.edu.cn> Date: Fri, 25 Jul 2025 16:45:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3examine=5Ffile=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E4=B8=AD=E7=9A=84=E8=B7=AF=E5=BE=84=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=EF=BC=8C=E5=B9=B6=E4=BC=98=E5=8C=96=E5=90=8E?= =?UTF-8?q?=E7=BB=AD=E8=B7=AF=E5=BE=84=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- func/utils/PublicFunc.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/func/utils/PublicFunc.py b/func/utils/PublicFunc.py index 474486a..fbc1740 100644 --- a/func/utils/PublicFunc.py +++ b/func/utils/PublicFunc.py @@ -191,6 +191,8 @@ class PublicFunc: @staticmethod def examine_file(path_str, filename, suffix): + if not isinstance(path_str, str): + path_str = str(path_str) temp_path = [p for p in Path(path_str).glob(f"{filename}*") if p.stem.startswith(filename) and p.suffix == suffix] if len(temp_path) == 0: @@ -214,13 +216,13 @@ class PublicFunc: info=Constants.INPUT_FAILURE + "\n" + filename + ":" + Constants.FAILURE_REASON["Data_Frequency_Not_In_Filename"]) - if Path(path).suffix != suffix: + if path.suffix != suffix: return Result().failure( info=Constants.INPUT_FAILURE + "\n" + filename + ":" + Constants.FAILURE_REASON["Suffix_Not_Correct"]) data = { - "path": str(path), + "path": path, "freq": int(freq) } return Result().success(data=data)