xxyzz / WordDumb

A calibre plugin that generates Kindle Word Wise and X-Ray files for KFX, AZW3, MOBI and EPUB eBook.
https://xxyzz.github.io/WordDumb/
GNU General Public License v3.0
386 stars 19 forks source link

"String not found"Error #35

Closed Nok09 closed 2 years ago

Nok09 commented 2 years ago

Describe the bug

Hi, it's me again, when I try to use WordDumb for some of my azw3 books, the error message with "string not found" error poped up sometimes at the very begining. It happens for both word wise and X-ray creation. I noticed that some books have this issue while the others do not, and I just couldn't figure out what is wrong with these azw3 files.

System Information

OS: Windows 11 Calibre: 5.43.0 64bit Python: 3.10.5 64bit Plugin: 3.21.1

Error message

calibre, version 5.43.0 (win32, embedded-python: True)
Tonnerre de Brest!: An error occurred, please copy error message then report bug at GitHub.

Starting job: Generating Word Wise and X-Ray for Gardens of the Moon: Book One of The Malazan Book of the Fallen 
Job: "Generating Word Wise and X-Ray for Gardens of the Moon: Book One of The Malazan Book of the Fallen" failed with error: 
Traceback (most recent call last):
  File "calibre\gui2\threaded_jobs.py", line 82, in start_work
  File "calibre_plugins.worddumb.parse_job", line 108, in do_job
  File "calibre_plugins.worddumb.parse_job", line 207, in create_files
  File "calibre_plugins.worddumb.parse_job", line 335, in find_named_entity
  File "calibre_plugins.worddumb.parse_job", line 256, in index_in_escaped_text
ValueError: substring not found

Called with args: ((10, 'AZW3', 'C:\\Users\\justi\\Calibre Library\\Steven Erikson\\Gardens of the Moon_ Book One of The (10)\\Gardens of the Moon_ Book One o - Steven Erikson.azw3', <calibre.ebooks.metadata.book.base.Metadata object at 0x0000029157830E50>, {'spacy': 'en_core_web_', 'wiki': 'en'}), True, True) {'notifications': <queue.Queue object at 0x0000029157830E80>, 'abort': <threading.Event object at 0x000002915087E8E0>, 'log': <calibre.utils.logging.GUILog object at 0x000002915087E820>}

Reproduce steps

  1. Go to Calibre
  2. Click on WordDumb
  3. Error message occured

Screenshots or videos

No response

xxyzz commented 2 years ago

Thanks for your report, this error is fixed in https://github.com/xxyzz/WordDumb/commit/41cae53b9fca3aec9c2de3a33e34c8d19a98f5f8.