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

Cannot generate x-ray and wordwise #115

Closed net-frog closed 1 year ago

net-frog commented 1 year ago

Checkboxes

Describe the bug

Hi

I am getting the following error when generating wordwise and x-ray.

System Information

OS: Ubuntu 20.04.6 LTS calibre version: Release: 6.15 Python 3.10.11 Plugin: 3.29.1

Error message

calibre, version 6.15.0 (linux, 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 The Wordy Shipmates 
Job: "Generating Word Wise and X-Ray for The Wordy Shipmates" 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 188, in do_job
    run_subprocess(args, input_str)
  File "calibre_plugins.worddumb.utils", line 51, in run_subprocess
    return subprocess.run(
  File "subprocess.py", line 524, in run
subprocess.CalledProcessError: Command '['python3', '/home/spi/.config/calibre/plugins/WordDumb.zip', '{"create_ww": true, "create_x": true, "asin": "BBUDRXNKLG", "book_path": "/home/spi/Calibre Library/Sarah Vowell/The Wordy Shipmates (166)/The Wordy Shipmates - Sarah Vowell.mobi", "acr": "The_Wordy_Shipmates", "revision": "d92b614e", "model": "en_core_web_lg", "lemma_lang": "en", "mobi_codec": "utf-8", "useragent": "WordDumb/3.29.1 (https://github.com/xxyzz/WordDumb)", "book_fmt": "MOBI", "plugin_path": "/home/spi/.config/calibre/plugins/WordDumb.zip"}', '{"use_pos": true, "search_people": true, "model_size": "lg", "zh_wiki_variant": "cn", "fandom": "", "add_locator_map": false, "preferred_formats": ["KFX", "AZW3", "AZW", "MOBI", "EPUB"], "use_all_formats": false, "minimal_x_ray_count": 1, "en_ipa": "ga_ipa", "zh_ipa": "pinyin", "choose_format_manually": true, "wiktionary_gloss_lang": "en", "kindle_gloss_lang": "en", "use_gpu": false, "cuda": "cu117", "last_opened_kindle_lemmas_language": "ca", "last_opened_wiktionary_lemmas_language": "ca", "use_wiktionary_for_kindle": false, "ca_wiktionary_difficulty_limit": 5, "da_wiktionary_difficulty_limit": 5, "de_wiktionary_difficulty_limit": 5, "el_wiktionary_difficulty_limit": 5, "en_wiktionary_difficulty_limit": 5, "es_wiktionary_difficulty_limit": 5, "fi_wiktionary_difficulty_limit": 5, "fr_wiktionary_difficulty_limit": 5, "hr_wiktionary_difficulty_limit": 5, "it_wiktionary_difficulty_limit": 5, "ja_wiktionary_difficulty_limit": 5, "ko_wiktionary_difficulty_limit": 5, "lt_wiktionary_difficulty_limit": 5, "mk_wiktionary_difficulty_limit": 5, "nl_wiktionary_difficulty_limit": 5, "no_wiktionary_difficulty_limit": 5, "pl_wiktionary_difficulty_limit": 5, "pt_wiktionary_difficulty_limit": 5, "ro_wiktionary_difficulty_limit": 5, "ru_wiktionary_difficulty_limit": 5, "sv_wiktionary_difficulty_limit": 5, "uk_wiktionary_difficulty_limit": 5, "zh_wiktionary_difficulty_limit": 5}']' returned non-zero exit status 1.

Called with args: ((166, 'MOBI', '/home/spi/Calibre Library/Sarah Vowell/The Wordy Shipmates (166)/The Wordy Shipmates - Sarah Vowell.mobi', <calibre.ebooks.metadata.book.base.Metadata object at 0x7f7687201690>, 'en'), True, True) {'notifications': <queue.Queue object at 0x7f766c1dbeb0>, 'abort': <threading.Event object at 0x7f768705df90>, 'log': <calibre.utils.logging.GUILog object at 0x7f768705ded0>} 
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/spi/.config/calibre/plugins/WordDumb.zip/__main__.py", line 40, in <module>
  File "/home/spi/.config/calibre/plugins/WordDumb.zip/parse_job.py", line 355, in create_files
  File "/home/spi/.config/calibre/plugins/WordDumb.zip/x_ray.py", line 197, in finish
  File "/home/spi/.config/calibre/plugins/WordDumb.zip/mediawiki.py", line 480, in query_mediawiki
  File "/home/spi/.config/calibre/plugins/WordDumb.zip/mediawiki.py", line 140, in query
  File "/home/spi/.config/calibre/plugins/WordDumb.zip/mediawiki.py", line 69, in add_cache
sqlite3.OperationalError: near "RETURNING": syntax error

Reproduce steps

  1. click on worddumb

Screenshots or videos

No response

xxyzz commented 1 year ago

The RETURNING syntax was added to SQLite since version 3.35.0 (2021-03-12). You'll need to update your Python or SQLite package by upgrading to at least Ubuntu 22.04.

net-frog commented 1 year ago

The issue is fixed after I upgraded to 22.04. Thanks for support