bookfere / Ebook-Translator-Calibre-Plugin

A Calibre plugin to translate ebook into a specified language.
https://translator.bookfere.com
GNU General Public License v3.0
1.68k stars 111 forks source link

[Bug report] Error exporting translated EPUB #357

Open karlquint opened 6 days ago

karlquint commented 6 days ago

Export error: lxml.etree.XMLSyntaxError: Namespace prefix epub for type on a is not defined

Describe the bug When trying to save / output a translated ebook (EPUB format), there is an error message:

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 42, in <module>
  File "site.py", line 38, in main
  File "calibre/utils/ipc/worker.py", line 215, in main
  File "calibre/utils/ipc/worker.py", line 150, in arbitrary_n
  File "calibre_plugins.ebook_translator.lib.conversion", line 242, in convert_item
  File "calibre_plugins.ebook_translator.lib.conversion", line 86, in convert_book
  File "calibre/ebooks/conversion/plumber.py", line 1307, in run
  File "calibre_plugins.ebook_translator.lib.conversion", line 74, in convert
  File "calibre_plugins.ebook_translator.lib.element", line 683, in add_translations
  File "calibre_plugins.ebook_translator.lib.element", line 286, in add_translation
  File "calibre_plugins.ebook_translator.lib.element", line 248, in _create_new_element
  File "src/lxml/etree.pyx", line 3266, in lxml.etree.XML
  File "src/lxml/parser.pxi", line 1989, in lxml.etree._parseMemoryDocument
  File "src/lxml/parser.pxi", line 1869, in lxml.etree._parseDoc
  File "src/lxml/parser.pxi", line 1105, in lxml.etree._BaseParser._parseUnicodeDoc
  File "src/lxml/parser.pxi", line 633, in lxml.etree._ParserContext._handleParseResultDoc
  File "src/lxml/parser.pxi", line 743, in lxml.etree._handleParseResult
  File "src/lxml/parser.pxi", line 672, in lxml.etree._raiseParseError
  File "<string>", line 1
lxml.etree.XMLSyntaxError: Namespace prefix epub for type on a is not defined, line 1, column 375

Expected behavior The export should work.

bookfere commented 4 days ago

I need a sample of the EPUB file to investigate the error. Please feel free to email it to me.

karlquint commented 2 days ago

Emailing it to you right now.