|
XPGT parsing "bug"
In doing a "modify ePub" of a batch of books to remove known artifacts and pro-actively remove margins from Adobe .xpgt files, I had several books "fail" when looking at the log file.
The "root cause" is that the epub's I was processing had empty (zero length/zero size) .xpgt files.
This *only* causes a problem when a user of Modify ePub selects several different options (like removing iTunes files or OS artifact files) AND remove margins. In that case the processing will fail. What really should happen is everything else "goes like normal" but the margins aren't removed (since there aren't any.) So maybe change the code to check for a zero length file and "skip it" if it is empty.
The error message in the log was:
File "calibre_plugins.modify_epub.modify", line 72, in process_book
File "calibre_plugins.modify_epub.modify", line 142, in _process_book
File "calibre_plugins.modify_epub.modify", line 313, in _zero_xpgt_margins
File "calibre_plugins.modify_epub.container", line 229, in get_parsed_etree
ParseError: Failed to parse: ops/styles/page-template.xpgt with error: None
ePub not changed after 1.52 seconds
From a feature question standpoint - is there a way to remove .xpgt files only if they are empty? I suppose it doesn't really matter if they exist if they are empty, but just curious.
|