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: