diff --git a/src/calibre/ebooks/conversion/plugins/html_input.py b/src/calibre/ebooks/conversion/plugins/html_input.py index 5717e79b24..4439456a08 100644 --- a/src/calibre/ebooks/conversion/plugins/html_input.py +++ b/src/calibre/ebooks/conversion/plugins/html_input.py @@ -22,7 +22,7 @@ from calibre.utils.imghdr import what def sanitize_file_name(x): ans = re.sub(r'\s+', ' ', re.sub(r'[?&=;#]', '_', ascii_filename(x))).strip().rstrip('.') ans, ext = ans.rpartition('.')[::2] - return ans.strip() + '.' + ext.strip() + return (ans.strip() + '.' + ext.strip()).rstrip('.') class HTMLInput(InputFormatPlugin):