From deb1ff37b21c45ccbfa7ddc485606ad3ed024782 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Thu, 31 Oct 2024 19:09:00 +0100 Subject: [PATCH] Escape characters in filename for kepub conversion --- cps/tasks/convert.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 cps/tasks/convert.py diff --git a/cps/tasks/convert.py b/cps/tasks/convert.py old mode 100644 new mode 100755 index dbdfae069..08eb63ce8 --- a/cps/tasks/convert.py +++ b/cps/tasks/convert.py @@ -18,7 +18,7 @@ import os import re -from glob import glob +import glob from shutil import copyfile, copyfileobj from markupsafe import escape from time import time @@ -242,7 +242,7 @@ class TaskConvert(CalibreTask): # move file if check == 0: - converted_file = glob(os.path.splitext(filename)[0] + "*.kepub.epub") + converted_file = glob.glob(glob.escape(os.path.splitext(filename)[0]) + "*.kepub.epub") if len(converted_file) == 1: copyfile(converted_file[0], (file_path + format_new_ext)) os.unlink(converted_file[0])