View Single Post
Old 02-12-2023, 12:15 AM   #107
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 47,053
Karma: 169810634
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
I ran into an error trying to use CustomCleanerPlus on an epub 2.0 that has an .svg image file in the images directory:

Spoiler:
Code:
Status: failed

Python version:  3.9.9 (tags/v3.9.9:ccb0e6a, Nov 15 2021, 18:08:50) [MSC v.1929 64 bit (AMD64)] 

Running CustomCleanerPlus...

 -- Copy to work dir...cover.xhtml
 -- Copy to work dir...part0000.html
 -- Copy to work dir...part0001.html
 -- Copy to work dir...part0002.html
 -- Copy to work dir...part0003.html
 -- Copy to work dir...part0004.html
 -- Copy to work dir...part0005.html
 -- Copy to work dir...part0006.html
 -- Copy to work dir...part0007.html
 -- Copy to work dir...part0008.html
 -- Copy to work dir...part0009.html
 -- Copy to work dir...part0010.html
 -- Copy to work dir...part0011.html
 -- Copy to work dir...part0012.html
 -- Copy to work dir...part0013.html
 -- Copy to work dir...part0014.html
 -- Copy to work dir...part0015.html
 -- Copy to work dir...part0016.html
 -- Copy to work dir...part0017.html
 -- Copy to work dir...part0018.html
 -- Copy to work dir...part0019.html
 -- Copy to work dir...part0020.html
 
 -- Copy images to work dir...C:\Users\David\AppData\Local\Temp\tmpkt1j49b8\cover.jpeg
 -- Copy images to work dir...C:\Users\David\AppData\Local\Temp\tmpkt1j49b8\svgimg0003.svg
Traceback (most recent call last):
  File "C:\Program Files\Sigil\plugin_launchers\python\launcher.py", line 142, in launch
    self.exitcode = target_script.run(container)
  File "C:\Users\David\AppData\Local\sigil-ebook\sigil\plugins\CustomCleanerPlus\plugin.py", line 141, in run
    i_ids, i_fnames = copyImageFiles2Dir(bk, WDIR)          # copy epub images
  File "C:\Users\David\AppData\Local\sigil-ebook\sigil\plugins\CustomCleanerPlus\cutils2.py", line 163, in copyImageFiles2Dir
    outfp.write(data)
TypeError: a bytes-like object is required, not 'str'
Error: a bytes-like object is required, not 'str'


Deleting the svg image file allowed CustomCleanerPlus to run. However despite setting the Remove all hyphen class properties from the CSS, the webkit-hyphenate-limit-whatever lines survived.
DNSB is offline   Reply With Quote