From a14989583ef2e1726f0005d9e75c960475f4a72d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederik=20=E2=80=9CFreso=E2=80=9D=20S=2E=20Olesen?= Date: Sat, 29 Apr 2017 14:25:17 +0200 Subject: [PATCH] Use regular str.split() to split template parts in disambiguation os.path.split() only even splits into two components, which means that path templates that have more than two parts (e.g., `%A/%d - %y/%X`) will not get split properly for the purpose of added disambiguation parts to them. os.path.join() will still work fine to splice the split template back together as it takes an arbitrary number of arguments. --- whipper/common/program.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/whipper/common/program.py b/whipper/common/program.py index 62e9ec8..8d6bebf 100644 --- a/whipper/common/program.py +++ b/whipper/common/program.py @@ -242,7 +242,7 @@ class Program: # when disambiguating, use catalogNumber then barcode if disambiguate: - templateParts = list(os.path.split(template)) + templateParts = template.split(os.sep) # Find the section of the template with the release name for i, part in enumerate(templateParts): if "%d" in part: