Error embedding fonts

Bug #1960180 reported by leastcommonancestor
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Unassigned

Bug Description

Trying to embed fonts in EPUB produces IndexError: list index out of range. Font spec is "Charis SIL", Georgia, serif. Error report is:

calibre, version 5.36.0
ERROR: Unhandled exception: <b>IndexError</b>:list index out of range

calibre 5.36 embedded-python: True is64bit: True
Linux-5.4.0-97-generic-x86_64-with-glibc2.2.5 Linux ('64bit', 'ELF')
('Linux', '5.4.0-97-generic', '#110-Ubuntu SMP Thu Jan 13 18:22:13 UTC 2022')
Python 3.8.5
Interface language: None
Successfully initialized third party plugins: Count Pages (1, 11, 2) && Embed Comic Metadata (1, 6, 1) && EpubMerge (2, 12, 0) && EpubSplit (3, 2, 0) && Fantastic Fiction (1, 5, 1) && Favourites Menu (1, 1, 0) && Find Duplicates (1, 9, 2) && Generate Cover (2, 1, 0) && Goodreads (1, 5, 3) && Markdown Output (1, 0, 3) && MultiColumnSearch (1, 0, 87) && Open With (1, 7, 0)
Traceback (most recent call last):
  File "calibre/gui2/tweak_book/boss.py", line 620, in polish
  File "calibre/ebooks/oeb/polish/main.py", line 312, in tweak_polish
  File "calibre/ebooks/oeb/polish/main.py", line 221, in polish_one
  File "calibre/ebooks/oeb/polish/embed.py", line 250, in embed_all_fonts
IndexError: list index out of range

Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1960180

That's because one of the html files in your book has no <head> run the
fix html tool first and you should be fine. I can of course have the
embed tool insert head for you, but doing this for every single tool is
not really possible. In general you should fix html before running other
tools.

Revision history for this message
Kovid Goyal (kovid) wrote : Fixed in master

Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.

 status fixreleased

Changed in calibre:
status: New → Fix Released
Revision history for this message
leastcommonancestor (leastcommonancestor) wrote : Re: [Bug 1960180] Re: calibre bug 1960180

The error occured with the attached file. As you can see, all text files
have a head tag. I also ran Fix HTML before posting the bug message.

Greetings

LCA

On 07.02.22 03:45, Kovid Goyal wrote:
> That's because one of the html files in your book has no <head> run the
> fix html tool first and you should be fine. I can of course have the
> embed tool insert head for you, but doing this for every single tool is
> not really possible. In general you should fix html before running other
> tools.
>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.