From e58887dfa731c329d46a35c29ab5ae2a084e6696 Mon Sep 17 00:00:00 2001 From: BazettFraga Date: Thu, 9 Feb 2023 01:30:06 +0100 Subject: [PATCH] forgot windows does double backslashes for paths due to its use as escape char. --- nodes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodes.py b/nodes.py index efa9522d..a9189c6f 100644 --- a/nodes.py +++ b/nodes.py @@ -30,8 +30,8 @@ def recursive_search(directory): result = [] for root, subdir, file in os.walk(directory, followlinks=True): for filepath in file: - #we remove the first character to remove the path separator. - result.append(os.path.join(root, filepath).replace(directory,'')[1:]) + #we os.path,join directory with a blank string to generate a path separator at the end. + result.append(os.path.join(root, filepath).replace(os.path.join(directory,''),'')) return result def filter_files_extensions(files, extensions):