Escape characters in filename for kepub conversion

This commit is contained in:
Ozzie Isaacs
2024-10-31 19:09:00 +01:00
parent 2927b5d544
commit deb1ff37b2
Regular → Executable
+2 -2
View File
@@ -18,7 +18,7 @@
import os import os
import re import re
from glob import glob import glob
from shutil import copyfile, copyfileobj from shutil import copyfile, copyfileobj
from markupsafe import escape from markupsafe import escape
from time import time from time import time
@@ -242,7 +242,7 @@ class TaskConvert(CalibreTask):
# move file # move file
if check == 0: 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: if len(converted_file) == 1:
copyfile(converted_file[0], (file_path + format_new_ext)) copyfile(converted_file[0], (file_path + format_new_ext))
os.unlink(converted_file[0]) os.unlink(converted_file[0])