Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError during file transfer #181

Open
athens46 opened this issue Jan 7, 2025 · 0 comments
Open

IndexError during file transfer #181

athens46 opened this issue Jan 7, 2025 · 0 comments

Comments

@athens46
Copy link

athens46 commented Jan 7, 2025

Certain books (about one in a thousand for my library) in the process of being transferred to Kobo will throw up the IndexError below. If the book producing an error is part of a larger transfer job, the IndexError causes the entire transfer to fail regardless of progress on other epubs. I can provide a couple epubs that trigger the issue.

Running 7.23.0. The following user-installed utilities are in use and up to date:
KePub Input 3.6.6
KePub Output 3.7.3
KoboTouchExtended 3.7.3
KePub Metadata Reader 3.4.3
Kobo Metadata 1.9.1
KePub Metadata Writer 3.4.3
Kobo Utilities 2.17.2

Debug log. Full error message below:

calibre, version 7.23.0
ERROR: Error: Error communicating with device

Failed to process What Is Tao? by Alan Watts: list index out of range

Traceback (most recent call last):
  File "calibre_plugins.kobotouch_extended.device.driver", line 188, in _modify_epub
    common.modify_epub()
  File "calibre_plugins.kobotouch_extended.common", line 238, in modify_epub
    container.convert()
  File "calibre_plugins.kobotouch_extended.container", line 398, in convert
    self.__run_async_over_content(self.add_kobo_spans)
  File "calibre_plugins.kobotouch_extended.container", line 394, in __run_async_over_content
    self.__run_async(func, names)
  File "calibre_plugins.kobotouch_extended.container", line 381, in __run_async
    raise e
  File "calibre_plugins.kobotouch_extended.container", line 377, in __run_async
    name = future.result(timeout=60)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "concurrent/futures/_base.py", line 449, in result
  File "concurrent/futures/_base.py", line 401, in __get_result
  File "concurrent/futures/thread.py", line 58, in run
  File "calibre_plugins.kobotouch_extended.container", line 522, in add_kobo_spans
    body = root.xpath("./xhtml:body", namespaces={"xhtml": XHTML_NAMESPACE})[0]
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "calibre/gui2/device.py", line 112, in run
  File "calibre/gui2/device.py", line 646, in _upload_books
  File "calibre_plugins.kobotouch_extended.device.driver", line 343, in upload_books
    return super(KOBOTOUCHEXTENDED, self).upload_books(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "calibre/devices/kobo/driver.py", line 2283, in upload_books
  File "calibre_plugins.kobotouch_extended.device.driver", line 212, in _modify_epub
    raise e.__class__(msg).with_traceback(tb)
  File "calibre_plugins.kobotouch_extended.device.driver", line 188, in _modify_epub
    common.modify_epub(
  File "calibre_plugins.kobotouch_extended.common", line 238, in modify_epub
    container.convert()
  File "calibre_plugins.kobotouch_extended.container", line 398, in convert
    self.__run_async_over_content(self.add_kobo_spans)
  File "calibre_plugins.kobotouch_extended.container", line 394, in __run_async_over_content
    self.__run_async(func, names)
  File "calibre_plugins.kobotouch_extended.container", line 381, in __run_async
    raise e
  File "calibre_plugins.kobotouch_extended.container", line 377, in __run_async
    name = future.result(timeout=60)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "concurrent/futures/_base.py", line 449, in result
  File "concurrent/futures/_base.py", line 401, in __get_result
  File "concurrent/futures/thread.py", line 58, in run
  File "calibre_plugins.kobotouch_extended.container", line 522, in add_kobo_spans
    body = root.xpath("./xhtml:body", namespaces={"xhtml": XHTML_NAMESPACE})[0]
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: Failed to process What Is Tao? by Alan Watts: list index out of range
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant