From 4fa00105b39a1b802deafaf3c34ca803cddeee16 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 10 Feb 2009 13:45:27 -0800 Subject: [PATCH] IGN:... --- src/calibre/ebooks/mobi/reader.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/mobi/reader.py b/src/calibre/ebooks/mobi/reader.py index 8b81702bc1..1c434c9472 100644 --- a/src/calibre/ebooks/mobi/reader.py +++ b/src/calibre/ebooks/mobi/reader.py @@ -309,7 +309,10 @@ class MobiReader(object): attrib['id'] = attrib.pop('filepos-id') if 'filepos' in attrib: filepos = attrib.pop('filepos') - attrib['href'] = "#filepos%s" % filepos + try: + attrib['href'] = "#filepos%d" % int(filepos) + except ValueError: + attrib['href'] = filepos if tag.tag == 'img': recindex = None for attr in self.IMAGE_ATTRS: