![]() |
#1411 |
Member
![]() Posts: 11
Karma: 10
Join Date: Nov 2011
Device: generic android 4.0
|
Here is the error message I get when trying to replace the cover on my epub. Thank you for all your work on these issues.
calibre, version 5.0.1 ERROR: Modify ePub failed: No ePub files were updated Modify ePubs Logfile for book ID 12789 (Batnesia / Qui) 12789 Modifying: C:\Users\Susan\AppData\Local\Temp\calibre_wxix24e5 \7gmx70w7_modify_epub\12789.epub Batnesia - ERROR: Traceback (most recent call last): File "calibre_plugins.modify_epub.modify", line 78, in process_book File "calibre_plugins.modify_epub.container", line 86, in __init__ File "src/lxml/etree.pyx", line 3237, in lxml.etree.fromstring File "src/lxml/parser.pxi", line 1891, in lxml.etree._parseMemoryDocument ValueError: Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration. ePub not changed after 0.15 seconds |
![]() |
![]() |
![]() |
#1412 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,756
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Last edited by JSWolf; 09-26-2020 at 10:48 AM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#1413 |
Member
![]() Posts: 11
Karma: 10
Join Date: Nov 2011
Device: generic android 4.0
|
|
![]() |
![]() |
![]() |
#1414 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Yet another test version. V1.5.2 could bork the ebook's OPF. It isn't clear exactly when it happened but I was able to reliably reproduce it with "delete cover". That operation didn't fail but it left the ebook unusable. Modify epub would blow up if executed again. I suspect that all ebook readers/editors would as well.
If you have damaged an ebook then you should be able to fix it using the base calibre polish tool, re-embedding metadata. My apologies for all the waffing around. I have never encountered code that messes so extensively with encodings like this plugin. Last edited by chaley; 09-28-2020 at 11:03 AM. Reason: Remove broken beta release |
![]() |
![]() |
![]() |
#1415 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,974
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
I ran Modify ePub on my test book with everything enabled. I ended up getting this log, although I'm not sure which option caused the error.
Code:
Modifying: C:\Users\[user]\AppData\Local\Temp\calibre_dpjv3o3j\bm1nikge_modify_epub\5036.epub Updating metadata and cover Parsing xml file: content.opf Parsing xml file: toc.ncx Looking for redundant entries in manifest Looking for unmanifested files Looking for NCX to flatten No nested navPoints Looking for broken links in the NCX Looking for Adobe xpgt files and links to remove Looking for pagemaps Looking for Google Play pagemaps Looking for Google Play pagemaps Looking for Adobe DRM meta tags to remove Looking for all jackets Jacket removed: jacket.xhtml Manifest item removed: jacket.xhtml (calibre_jacket) Spine itemref removed: calibre_jacket Adding or updating jacket Manifest item added: jacket.xhtml (calibre_jacket) Spine item inserted: calibre_jacket at pos: -1 Looking for html pages containing only broken image links Looking for non dc: elements in manifest Removing child: <Element {http://www.idpf.org/2007/opf}meta at 0x16ff4cdc6c0> Removing child: <Element {http://www.idpf.org/2007/opf}meta at 0x16ff4cdc8c0> Removing child: <Element {http://www.idpf.org/2007/opf}meta at 0x16ff4cdc9c0> Removing child: <Element {http://www.idpf.org/2007/opf}meta at 0x16ff4cdc940> Removing child: <Element {http://www.idpf.org/2007/opf}meta at 0x16ff4cdc840> Removing child: <Element {http://www.idpf.org/2007/opf}meta at 0x16ff4cdc600> Removing child: <Element {http://www.idpf.org/2007/opf}meta at 0x16ff4cdc780> Removing child: <Element {http://www.idpf.org/2007/opf}meta at 0x16ff4cdc680> Removing child: <Element {http://www.idpf.org/2007/opf}meta at 0x16ff4cdc740> Removing child: <Element {http://www.idpf.org/2007/opf}meta at 0x16ff4cdce00> Removing child: <Element {http://www.idpf.org/2007/opf}meta at 0x16ff4cdcc80> Removing child: <Element {http://www.idpf.org/2007/opf}meta at 0x16ff4cdca00> Removing child: <Element {http://www.idpf.org/2007/opf}meta at 0x16ff4cdc440> Removing child: <Element {http://www.idpf.org/2007/opf}meta at 0x16ff4cdcdc0> Removing child: <Element {http://www.idpf.org/2007/opf}meta at 0x16ff4cdcd80> Removing child: <Element {http://www.idpf.org/2007/opf}meta at 0x16ff4cdcc00> Removing child: <Element {http://www.idpf.org/2007/opf}meta at 0x16ff4cdcb80> Removing child: <Element {http://www.idpf.org/2007/opf}meta at 0x16ff4cdcb00> Removing child: <Element {http://www.idpf.org/2007/opf}meta at 0x16ff4cdcec0> Removing child: <Element {http://www.idpf.org/2007/opf}meta at 0x16ff4cdcf00> Removing child: <Element {http://www.idpf.org/2007/opf}meta at 0x16ff4cdcbc0> Removing child: <Element {http://www.idpf.org/2007/opf}meta at 0x16ff4cdcc40> Looking for html files to remove charset meta tags/encode to utf-8 Switched to UTF-8 encoding for: text/part0000.html Switched to UTF-8 encoding for: text/part0001.html Switched to UTF-8 encoding for: text/part0002.html Switched to UTF-8 encoding for: text/part0003.html Switched to UTF-8 encoding for: text/part0004.html Switched to UTF-8 encoding for: text/part0005.html Switched to UTF-8 encoding for: text/part0006.html Switched to UTF-8 encoding for: text/part0007.html Switched to UTF-8 encoding for: text/part0008.html Switched to UTF-8 encoding for: text/part0009.html Switched to UTF-8 encoding for: text/part0010.html Switched to UTF-8 encoding for: text/part0011.html Switched to UTF-8 encoding for: text/part0012.html Switched to UTF-8 encoding for: text/part0013.html Switched to UTF-8 encoding for: text/part0014.html Switched to UTF-8 encoding for: text/part0015.html Switched to UTF-8 encoding for: text/part0016.html Switched to UTF-8 encoding for: text/part0017.html Switched to UTF-8 encoding for: text/part0018.html Switched to UTF-8 encoding for: text/part0019.html Switched to UTF-8 encoding for: text/part0020.html Switched to UTF-8 encoding for: text/part0021.html Switched to UTF-8 encoding for: text/part0022.html Switched to UTF-8 encoding for: text/part0023.html Switched to UTF-8 encoding for: text/part0024.html Switched to UTF-8 encoding for: text/part0025.html Switched to UTF-8 encoding for: text/part0026.html Switched to UTF-8 encoding for: text/part0027.html Switched to UTF-8 encoding for: text/part0028.html Switched to UTF-8 encoding for: text/part0029.html Switched to UTF-8 encoding for: text/part0030.html Switched to UTF-8 encoding for: text/part0031.html Switched to UTF-8 encoding for: text/part0032.html Switched to UTF-8 encoding for: text/part0033.html Switched to UTF-8 encoding for: text/part0034.html Switched to UTF-8 encoding for: text/part0035.html Switched to UTF-8 encoding for: text/part0036.html Switched to UTF-8 encoding for: text/part0037.html Switched to UTF-8 encoding for: text/part0038.html Switched to UTF-8 encoding for: text/part0039.html Switched to UTF-8 encoding for: text/part0040.html Switched to UTF-8 encoding for: text/part0041.html Switched to UTF-8 encoding for: text/titlepage.xhtml Looking for embedded fonts Looking for css @font-face style declarations Looking for inline @font-face style declarations Looking for CSS margins Modified CSS margins in: page_styles.css Modified CSS margins in: stylesheet.css No Cats Allowed - ERROR: Traceback (most recent call last): File "calibre_plugins.modify_epub.modify", line 79, in process_book File "calibre_plugins.modify_epub.modify", line 175, in _process_book File "calibre_plugins.modify_epub.modify", line 423, in _rewrite_css_margins File "calibre_plugins.modify_epub.margins", line 170, in rewrite_css_margins File "calibre_plugins.modify_epub.container", line 217, in get_raw File "codecs.py", line 322, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte ePub not changed after 0.70 seconds |
![]() |
![]() |
Advert | |
|
![]() |
#1416 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,756
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Code:
calibre, version 4.23.0 ERROR: Modify ePub failed: No ePub files were updated Modify ePubs Logfile for book ID 2243 (The Eye of the World / Robert Jordan) 2243 Modifying: C:\Users\help\AppData\Local\Temp\calibre_paxpnh\yncehy_modify_epub\2243.epub Parsing xml file: OPS/package.opf Parsing xml file: OPS/toc.ncx Looking for html files to remove charset meta tags/encode to utf-8 Switched to UTF-8 encoding for: OPS/xhtml/chapter42.html Switched to UTF-8 encoding for: OPS/xhtml/chapter37.html Switched to UTF-8 encoding for: OPS/xhtml/chapter10.html Switched to UTF-8 encoding for: OPS/xhtml/chapter12.html Switched to UTF-8 encoding for: OPS/xhtml/chapter18.html Switched to UTF-8 encoding for: OPS/xhtml/chapter30.html Switched to UTF-8 encoding for: OPS/xhtml/chapter16.html Switched to UTF-8 encoding for: OPS/xhtml/chapter03.html Switched to UTF-8 encoding for: OPS/xhtml/copyright.html Switched to UTF-8 encoding for: OPS/xhtml/backmatter02-ch.html Switched to UTF-8 encoding for: OPS/xhtml/chapter24.html Switched to UTF-8 encoding for: OPS/xhtml/chapter05.html Switched to UTF-8 encoding for: OPS/xhtml/frontmatter02.html Switched to UTF-8 encoding for: OPS/xhtml/chapter28.html Switched to UTF-8 encoding for: OPS/xhtml/chapter17.html Switched to UTF-8 encoding for: OPS/xhtml/chapter26.html Switched to UTF-8 encoding for: OPS/xhtml/frontmatter03.html Switched to UTF-8 encoding for: OPS/xhtml/chapter46.html Switched to UTF-8 encoding for: OPS/xhtml/chapter25.html Switched to UTF-8 encoding for: OPS/xhtml/chapter43.html Switched to UTF-8 encoding for: OPS/xhtml/chapter06.html Switched to UTF-8 encoding for: OPS/xhtml/package_notice.html Switched to UTF-8 encoding for: OPS/xhtml/frontmatter01.html Switched to UTF-8 encoding for: OPS/xhtml/chapter04.html Switched to UTF-8 encoding for: OPS/xhtml/chapter53.html Switched to UTF-8 encoding for: OPS/xhtml/adcard.html Switched to UTF-8 encoding for: OPS/xhtml/chapter50.html Switched to UTF-8 encoding for: OPS/xhtml/contents.html Switched to UTF-8 encoding for: OPS/xhtml/chapter41.html Switched to UTF-8 encoding for: OPS/xhtml/chapter29.html Switched to UTF-8 encoding for: OPS/xhtml/backmatter02.html Switched to UTF-8 encoding for: OPS/xhtml/chapter27.html Switched to UTF-8 encoding for: OPS/xhtml/chapter22.html Switched to UTF-8 encoding for: OPS/xhtml/chapter08.html Switched to UTF-8 encoding for: OPS/xhtml/cover.html Switched to UTF-8 encoding for: OPS/xhtml/chapter14.html Switched to UTF-8 encoding for: OPS/xhtml/backmatter01.html Switched to UTF-8 encoding for: OPS/xhtml/chapter52.html Switched to UTF-8 encoding for: OPS/xhtml/chapter02.html Switched to UTF-8 encoding for: OPS/xhtml/backmatter03.html Switched to UTF-8 encoding for: OPS/xhtml/chapter33.html Switched to UTF-8 encoding for: OPS/xhtml/chapter09.html Switched to UTF-8 encoding for: OPS/xhtml/chapter11.html Switched to UTF-8 encoding for: OPS/xhtml/chapter07.html Switched to UTF-8 encoding for: OPS/xhtml/chapter40.html Switched to UTF-8 encoding for: OPS/xhtml/chapter23.html Switched to UTF-8 encoding for: OPS/xhtml/chapter35.html Switched to UTF-8 encoding for: OPS/xhtml/chapter13.html Switched to UTF-8 encoding for: OPS/xhtml/chapter47.html Switched to UTF-8 encoding for: OPS/xhtml/chapter20.html Switched to UTF-8 encoding for: OPS/xhtml/chapter51.html Switched to UTF-8 encoding for: OPS/xhtml/chapter34.html Switched to UTF-8 encoding for: OPS/xhtml/chapter49.html Switched to UTF-8 encoding for: OPS/xhtml/chapter44.html Switched to UTF-8 encoding for: OPS/xhtml/chapter38.html Switched to UTF-8 encoding for: OPS/xhtml/chapter39.html Switched to UTF-8 encoding for: OPS/xhtml/title.html Switched to UTF-8 encoding for: OPS/xhtml/chapter31.html Switched to UTF-8 encoding for: OPS/xhtml/chapter19.html Switched to UTF-8 encoding for: OPS/xhtml/chapter01.html Switched to UTF-8 encoding for: OPS/xhtml/chapter36.html Switched to UTF-8 encoding for: OPS/xhtml/chapter45.html Switched to UTF-8 encoding for: OPS/xhtml/dedication.html Switched to UTF-8 encoding for: OPS/xhtml/chapter15.html Switched to UTF-8 encoding for: OPS/xhtml/chapter21.html Switched to UTF-8 encoding for: OPS/xhtml/chapter32.html Switched to UTF-8 encoding for: OPS/xhtml/chapter48.html Looking for embedded fonts Looking for css @font-face style declarations Looking for inline @font-face style declarations Looking for CSS margins The Eye of the World - ERROR: Traceback (most recent call last): File "calibre_plugins.modify_epub.modify", line 79, in process_book File "calibre_plugins.modify_epub.modify", line 175, in _process_book File "calibre_plugins.modify_epub.modify", line 423, in _rewrite_css_margins File "calibre_plugins.modify_epub.margins", line 170, in rewrite_css_margins File "calibre_plugins.modify_epub.container", line 217, in get_raw File "codecs.py", line 314, in decode UnicodeDecodeError: 'utf8' codec can't decode byte 0xff in position 0: invalid start byte ePub not changed after 1.23 seconds Code:
calibre, version 4.23.0 ERROR: Modify ePub failed: No ePub files were updated Modify ePubs Logfile for book ID 2243 (The Eye of the World / Robert Jordan) 2243 Modifying: C:\Users\help\AppData\Local\Temp\calibre_paxpnh\k2v2mo_modify_epub\2243.epub Parsing xml file: OPS/package.opf Parsing xml file: OPS/toc.ncx Looking for CSS margins The Eye of the World - ERROR: Traceback (most recent call last): File "calibre_plugins.modify_epub.modify", line 79, in process_book File "calibre_plugins.modify_epub.modify", line 175, in _process_book File "calibre_plugins.modify_epub.modify", line 423, in _rewrite_css_margins File "calibre_plugins.modify_epub.margins", line 170, in rewrite_css_margins File "calibre_plugins.modify_epub.container", line 217, in get_raw File "codecs.py", line 314, in decode UnicodeDecodeError: 'utf8' codec can't decode byte 0xff in position 0: invalid start byte ePub not changed after 1.11 seconds I've attached a scrambled ePub that shows the error. Last edited by JSWolf; 09-26-2020 at 12:20 PM. |
|
![]() |
![]() |
![]() |
#1417 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,756
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#1418 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,251
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
Quote:
![]() When I was migrating my own plugins to python3 I found these 2 items from polyglot.builtins very useful: as_unicode, as_bytes After I'd finished I don't think I had any .encode(...) or .decode(...) code left to go wrong. However, (full disclosure) I only ever use calibre's current container class to do everything related to epub-wrangling, so it's quite likely Kovid has already catered for everything that's likely to go wrong encoding-wise. |
|
![]() |
![]() |
![]() |
#1419 |
Running with scissors
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,587
Karma: 14328510
Join Date: Nov 2019
Device: none
|
There are pages on the python site about how to convert python 2 to python 3 and things that will need to be fixed. One of the items was about how with python 2 the code could treat characters as binary data, but you can no longer do that with python 3. I suspect that this error is due to that.
|
![]() |
![]() |
![]() |
#1420 |
Running with scissors
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,587
Karma: 14328510
Join Date: Nov 2019
Device: none
|
|
![]() |
![]() |
![]() |
#1421 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Also, the plugin has a reimplemented container. I tried to go back to calibre's but that opened more cans than I could handle. |
|
![]() |
![]() |
![]() |
#1422 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Yet another test version. This one corrects problems caused image files.
Last edited by chaley; 09-26-2020 at 03:02 PM. Reason: Removed wrong zipfile |
![]() |
![]() |
![]() |
#1423 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
I already fixed a similar problem when writing. |
|
![]() |
![]() |
![]() |
#1424 | |
Running with scissors
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,587
Karma: 14328510
Join Date: Nov 2019
Device: none
|
Quote:
See if this helps: https://docs.python.org/3/howto/pypo...us-binary-data |
|
![]() |
![]() |
![]() |
#1425 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
![]() |
![]() |
![]() |
Tags |
modify epub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] Quality Check | kiwidude | Plugins | 1251 | 07-07-2025 09:13 PM |
[GUI Plugin] Open With | kiwidude | Plugins | 404 | 02-21-2025 05:42 AM |
[GUI Plugin] Manage Series | kiwidude | Plugins | 167 | 07-28-2024 03:07 PM |
Modify ePub plugin dev thread | kiwidude | Development | 346 | 09-02-2013 05:14 PM |
[GUI Plugin] Plugin Updater **Deprecated** | kiwidude | Plugins | 159 | 06-19-2011 12:27 PM |