HTMLZ Failing To Open With ebook-viewer

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

Bug Description

I am having a similar error to https://www.mobileread.com/forums/sh....php?p=4365936. Below is the error message. I tried uninstalling, clearing out all cache, reinstalling, and installing the flatpak. I can confirm it opens fine on Windows 11 but it fails on Pop OS 22.04.

calibre, version 7.22.0
...
Failed to convert book: ... with error:
InputFormatPlugin: HTLZ Input running
on ...
Multiple HTML files found in the archive. Only index.html will be used.
Language not specified
Creator not specified
Building file list...
Normalizing filename cases
Rewriting HTML links
Forcing index1.html into XHTML namespace
Failed to run pipe worker with command: from calibre.srv.render_book import viewer_main; viewer_main()
Traceback (most recent call last):
File "runpy.py", line 198, in _run_module_as_main
File "runpy.py", line 88, in _run_code
File "site.py", line 47, in <module>
File "site.py", line 43, in main
File "calibre/utils/ipc/worker.py", line 196, in main
File "<string>", line 1, in <module>
File "calibre/srv/render_book.py", line 847, in viewer_main
File "calibre/srv/render_book.py", line 838, in render_for_viewer
File "calibre/srv/render_book.py", line 816, in render
File "calibre/srv/render_book.py", line 606, in process_exploded_book
File "calibre/srv/render_book.py", line 251, in create_cover_page
File "calibre/ebooks/oeb/polish/container.py", line 1000, in generate_item
IndexError: list index out of range

Digging, I tried running calibre-debug on render_book.py and I ran into this issue:

vm@pop-os:~/AB/epubshrink/_3/calibre-7.22.0$ calibre-debug src/calibre/srv/render_book.py FILENAME
InputFormatPlugin: HTLZ Input running
on FILENAME
Multiple HTML files found in the archive. Only index.html will be used.
Language not specified
Creator not specified
Building file list...
Normalizing filename cases
Rewriting HTML links
Forcing index1.html into XHTML namespace
Traceback (most recent call last):
  File "runpy.py", line 198, in _run_module_as_main
  File "runpy.py", line 88, in _run_code
  File "site.py", line 47, in <module>
  File "site.py", line 43, in main
  File "calibre/debug.py", line 314, in main
  File "calibre/debug.py", line 215, in run_script
  File "polyglot/builtins.py", line 110, in exec_path
  File "/home/vm/AB/epubshrink/_3/calibre-7.22.0/src/calibre/srv/render_book.py", line 894, in <module>
    develop()
  File "/home/vm/AB/epubshrink/_3/calibre-7.22.0/src/calibre/srv/render_book.py", line 885, in develop
    render(
  File "/home/vm/AB/epubshrink/_3/calibre-7.22.0/src/calibre/srv/render_book.py", line 816, in render
    container, bookmark_data = process_exploded_book(
                               ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vm/AB/epubshrink/_3/calibre-7.22.0/src/calibre/srv/render_book.py", line 606, in process_exploded_book
    raster_cover_name, titlepage_name = create_cover_page(container, input_fmt.lower(), is_comic, book_metadata)
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vm/AB/epubshrink/_3/calibre-7.22.0/src/calibre/srv/render_book.py", line 251, in create_cover_page
    item = container.generate_item(name='titlepage.html', id_prefix='titlepage')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "calibre/ebooks/oeb/polish/container.py", line 1000, in generate_item
IndexError: list index out of range

Revision history for this message
Alex Batrakov (alekovine) wrote :
Revision history for this message
Kovid Goyal (kovid) wrote :

Works fine for me with the official calibre linux binaries. I'm afraid
the flatpak is not supported. Use the official binaries and you should
be fine.

Changed in calibre:
status: New → Invalid
Revision history for this message
Alex Batrakov (alekovine) wrote :

Sorry, I don't think I explained very well. I did install it via the official install script. That didn't work so I uninstalled it and reinstalled it. That didn't work either. So I tried the flatpak version after the official version didn't work. The flatpak version failed too.

I think saying this bug is invalid if it works on your machine is a bit premature, no? There seems to be a bug with the render_book.py as shown in my initial comment.

Also, thank you for creating and maintaining calibre!

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

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

Changed in calibre:
status: Invalid → Fix Released
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.