View Single Post
Old 08-17-2022, 01:01 AM   #1678
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by listyraesder View Post
Code:
calibre, version 6.3.0
ERROR: Modify ePub changed no files: No ePub files were updated. If this isn't what you expected then press the Show details button to check for errors in the log.

Modify ePubs version (1, 7, 3)
Logfile for book ID 7598 (Stephen / Carl Watkins)
Job details 7598
  Modifying:  /tmp/calibre_6.3.0_tmp_izs4c261/jjbi1ux2_modify_epub/7598.epub
	  Parsing xml file: OPS/package.opf
	  Parsing xml file: OPS/toc.ncx
	Looking for broken links in the NCX
	ncx name:  OPS/toc.ncx
	Looping over ncx entries
	Looking for Adobe xpgt files and links to remove
Stephen - ERROR: Traceback (most recent call last):
  File "calibre_plugins.modify_epub.modify", line 78, in process_book
    is_modified = self._process_book(container, options)
  File "calibre_plugins.modify_epub.modify", line 140, in _process_book
    is_changed |= self._remove_xpgt_files(container)
  File "calibre_plugins.modify_epub.modify", line 392, in _remove_xpgt_files
    for match in RE_CSS_IMPORT1.finditer(data):
TypeError: cannot use a string pattern on a bytes-like object

ePub not changed after 0.32 seconds
So this is occurring on a small handful of books.
  • The plugin runs fine with Remove xpgt files unchecked.
  • The files are all EPUB 3.
  • The files don't have xpgt files inside them.
The line in error is using a regex to search for the import of the XPGT files in the CSS and HTMLX files. The error is that the text pulled from these is not a string, but, a bytes-like object. That suggests that the file causing the error has the wrong encoding. It's possible that the error check in the calibre editor will show which file has the error. Otherwise, we would have to see the book to see why it is going wrong.
davidfor is offline   Reply With Quote