View Single Post
Old 03-03-2020, 06:29 PM   #12
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,792
Karma: 30237628
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by gol8erl8 View Post
@BetterRed Thanks again for the great information. This time, unfortunately, I tested it on A Tale of Two Cities, both the original and after Edit metadata in bulk, and got the following error message:

Spoiler:
Code:
calibre, version 4.10.1 (linux, embedded-python: False)
Failed to modify ePubs: Failed: Modify ePubs

Modify ePubs
Traceback (most recent call last):
  File "/usr/bin/calibre-parallel", line 20, in <module>
    sys.exit(main())
  File "/usr/lib64/calibre/calibre/utils/ipc/worker.py", line 208, in main
    result = func(*args, **kwargs)
  File "/usr/lib64/calibre/calibre/utils/ipc/worker.py", line 142, in arbitrary_n
    module = importlib.import_module(module_name)
  File "/usr/lib64/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
  File "/usr/lib64/calibre/calibre/customize/zipplugin.py", line 184, in load_module
    exec(compiled, mod.__dict__)
  File "calibre_plugins.modify_epub.jobs", line 14, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
  File "/usr/lib64/calibre/calibre/customize/zipplugin.py", line 180, in load_module
    import_name), 'exec', dont_inherit=True)

File "calibre_plugins.modify_epub.modify", line 479
new_html = re.sub(r'<\?xml([^\?]*?)\?><', r'<?xml\1?>\n<', new_html)
^
TabError: inconsistent use of tabs and spaces in indentation
Hmmm- that's a bug in the code,

Click image for larger version

Name:	Annotation 2020-03-04 100707.jpg
Views:	168
Size:	119.2 KB
ID:	177489

Could you try installing the attached version of Modify

I wonder what your ePub has that causes it to follow that code path. Let me know if works (it works for me but I wasn't running up against the error), I have asked the person who changed the code last (Rev.Bob) to take a took at this thread, he is the person most familiar with code.

Interpreted languages that use code indentation to define scope ain't one of my favourite things - I'm more of a schnitzel with noodles sort of guy

BR
Attached Files
File Type: zip Modify ePub.zip (75.9 KB, 146 views)

Last edited by BetterRed; 03-03-2020 at 06:53 PM.
BetterRed is offline   Reply With Quote