From 237e4a94550d5ca47223cea70e925e3488ba39f6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 26 Sep 2016 11:28:25 +0530 Subject: [PATCH] Edit Book: Auto-add file extension when using the Save a Copy dialog if it is missing. Fixes #1627482 [save a copy as EPUB does not add automatically .epub extension to file](https://bugs.launchpad.net/calibre/+bug/1627482) --- src/calibre/gui2/tweak_book/boss.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calibre/gui2/tweak_book/boss.py b/src/calibre/gui2/tweak_book/boss.py index fa6144f300..58366e6793 100644 --- a/src/calibre/gui2/tweak_book/boss.py +++ b/src/calibre/gui2/tweak_book/boss.py @@ -1065,6 +1065,8 @@ class Boss(QObject): filters=[(_('Book (%s)') % ext.upper(), [ext.lower()])], all_files=False) if not path: return + if '.' not in os.path.basename(path): + path += '.' + ext.lower() tdir = self.mkdtemp(prefix='save-copy-') container = clone_container(c, tdir) for name, ed in editors.iteritems():