@ Kovid,
I found a problem when using my ScrambleEbook plugin. The problem arises when trying to scramble GIF images (JPG, JPEG, PNG, SVG seem OK).
This is the error message:
Code:
calibre, version 2.56.0
ERROR: Unhandled exception: <b>TypeError</b>:file() argument 1 must be encoded string without NULL bytes, not str
calibre 2.56 [64bit] embedded-python: True is64bit: True
Windows-7-6.1.7601-SP1 Windows ('64bit', 'WindowsPE')
('Windows', '7', '6.1.7601')
Python 2.7.9
Windows: ('7', '6.1.7601', 'SP1', 'Multiprocessor Free')
Successfully initialized third party plugins: DeDRM && Obok DeDRM && ScrambleEbook && Fantastic Fiction && Goodreads && JS Mod Epub && Diaps Editing Toolbag && DOC Input && KePub Metadata Writer && Barnes & Noble && Search The Internet && Count Pages && Wiki Reader && Quality Check && Open With && Copy Cover To Device && EpubSplit && JSTest Plugin && KindleUnpack - The Plugin && KePub Metadata Reader && Extract ISBN && KePub Input && Modify ePub && KoboTouchCSSEdit && Kobo Utilities && KePub Output && KoboBooks
Traceback (most recent call last):
File "calibre_plugins.scrambleebook_plugin.scrambleebook", line 334, in create_scramble_book
File "calibre_plugins.scrambleebook_plugin.scrambleebook", line 409, in __init__
File "calibre_plugins.scrambleebook_plugin.scrambleebook", line 437, in scramble_main
File "calibre_plugins.scrambleebook_plugin.scrambleebook", line 540, in scramble_img
File "site-packages\calibre\utils\magick\legacy.py", line 135, in export
File "site-packages\Pillow-2.4.0-py2.7-win-amd64.egg\PIL\Image.py", line 2093, in open
TypeError: file() argument 1 must be encoded string without NULL bytes, not str
This is the Python method where the error occurs (the
red line). It processes all image formats except .SVG:
- The relevant import: from calibre.utils.magick import Image
- self.eb is a standard calibre container object (epub/azw)
I've attached a test epub in case you need it.