From a3d71097d289f0202cb8d1ab793b7c93d009d623 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 25 Aug 2011 16:08:29 -0600 Subject: [PATCH] ... --- src/calibre/ebooks/mobi/writer2/serializer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/mobi/writer2/serializer.py b/src/calibre/ebooks/mobi/writer2/serializer.py index 9bbaa436a7..247adbf7c7 100644 --- a/src/calibre/ebooks/mobi/writer2/serializer.py +++ b/src/calibre/ebooks/mobi/writer2/serializer.py @@ -85,7 +85,8 @@ class Serializer(object): spine_item(item).is_section_start = True for i, article in enumerate(articles): si = spine_item(article) - si.is_article_start = True + if si is not None: + si.is_article_start = True items = list(self.oeb.spine) in_sec = in_art = False @@ -116,7 +117,7 @@ class Serializer(object): buf.write(b'') self.end_offset = buf.tell() self.fixup_links() - if self.start_offset is None: + if self.start_offset is None and not self.is_periodical: # If we don't set a start offset, the stupid Kindle will # open the book at the location of the first IndexEntry, which # could be anywhere. So ensure the book is always opened at the