From 709f5810e6aa029da9ccfa0367cc4391d049b77e Mon Sep 17 00:00:00 2001 From: Brent Huisman Date: Mon, 29 Jan 2024 22:12:21 +0100 Subject: [PATCH] Escape _all_ glob.globs. Fixes #24 --- par2deep/par2deep.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/par2deep/par2deep.py b/par2deep/par2deep.py index 5b33b45..5ec9ecc 100644 --- a/par2deep/par2deep.py +++ b/par2deep/par2deep.py @@ -143,7 +143,7 @@ def check_state(self): return 200 #if 200, then par2 doesnt exist. - allfiles = [f for f in glob.glob(os.path.join(self.directory,"**","*"), recursive=True) if os.path.isfile(f)] #not sure why required, but glob may introduce paths... + allfiles = [f for f in glob.glob(os.path.join(glob.escape(self.directory),"**","*"), recursive=True) if os.path.isfile(f)] #not sure why required, but glob may introduce paths... if 'root' in self.excludes: allfiles = [f for f in allfiles if os.path.dirname(f) != self.directory]