From 3f5a51aa6cb63641c963d827016148441e2613f1 Mon Sep 17 00:00:00 2001 From: simonmicro Date: Wed, 8 Apr 2026 17:43:41 +0200 Subject: [PATCH] Fixed EPERM on Linux in case track name starts with leading slash --- spotrec.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spotrec.py b/spotrec.py index 91f7ce1..3cb4c82 100755 --- a/spotrec.py +++ b/spotrec.py @@ -337,8 +337,9 @@ def run(self): # Create output folder if necessary # If filename_pattern specifies subfolder(s) the track name is only the basename while the dirname is the subfolder path + # Note, the basename()-call on the track name ensures stripping of leading slashes in case these were reported self.out_dir = os.path.join( - _output_directory, os.path.dirname(self.parent.track)) + _output_directory, os.path.basename(os.path.dirname(self.parent.track))) Path(self.out_dir).mkdir( parents=True, exist_ok=True)