From dba4ed0d766680a084b02c35692bd2b76448f2ba Mon Sep 17 00:00:00 2001 From: "Zong-han, Xie" Date: Sun, 17 May 2026 21:06:28 +0800 Subject: [PATCH] Fixed issue-786 Modified if statement to handle PosixPath instance file name in the same way with handling string file name. --- modmesh/track/dataframe.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modmesh/track/dataframe.py b/modmesh/track/dataframe.py index e8844012c..a4e29eb85 100644 --- a/modmesh/track/dataframe.py +++ b/modmesh/track/dataframe.py @@ -67,7 +67,8 @@ def read_from_text_file( :return: None """ - if isinstance(fname, str): + import pathlib + if isinstance(fname, str) or isinstance(fname, pathlib.PosixPath): if not os.path.exists(fname): raise Exception("Text file '{}' does not exist".format(fname)) fid = open(fname, 'rt')