From bb83f91018e035b0ac56586ecbce3c61fab92a09 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 31 Jul 2009 12:08:20 -0600 Subject: [PATCH] Handle author names that end with a period correctly when saving a single format to disk --- src/calibre/library/database2.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/library/database2.py b/src/calibre/library/database2.py index d477389875..6e04f835b9 100644 --- a/src/calibre/library/database2.py +++ b/src/calibre/library/database2.py @@ -1678,8 +1678,11 @@ books_series_link feeds au = self.authors(id, index_is_id=True) if not au: au = _('Unknown') - fname = '%s - %s.%s'%(title, au, format.lower()) + fname = '%s - %s'%(title, au) + while fname.endswith('.'): + fname = fname[:-1] fname = ascii_filename(fname) + fname = fname + '.' + format.lower() dir = os.path.abspath(dir) fname = shorten_components_to(plen - len(dir), (fname,))[0] if not os.path.exists(dir):