From 04996793b9822c5c9d7ca3e26ca38123f63a4346 Mon Sep 17 00:00:00 2001 From: "Matthias@Dell" Date: Thu, 27 Apr 2023 01:40:56 +0200 Subject: [PATCH] Fixed bug in get_next_filename --- k-teng/utility/file_io.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/k-teng/utility/file_io.py b/k-teng/utility/file_io.py index a16946b..710b16a 100644 --- a/k-teng/utility/file_io.py +++ b/k-teng/utility/file_io.py @@ -23,7 +23,8 @@ def get_next_filename(basename, directory=".", digits=3): for file in files: if not file.startswith(basename): continue try: - number = int(file.split('.')[0].strip(basename)) + number = file[:file.rfind('.')].replace(basename, "") + number = int(number) if number < lowest_number: continue lowest_number = number except ValueError: