Another issue I've found. (Win10, portable calibre 4.99 w/ py3 branch source.)
In Python3.7, zipfile.py wants the file-like objects it is handed to have attribute
seekable.
SpooledTemporaryFile doesn't always have that attribute.
Calibre's db.format(..., as_file=True) hands out a
SpooledTemporaryFile (child class). Which I can't read as a zip file, rather defeating the purpose of asking for an epub, for example.
There is an
Explanation about why SpooledTemporaryFile isn't seekable.
So the question is, should Calibre return something else for db.format(..., as_file=True), or should plugins not call that when they want a usable zip file?
Method db.cover(..., as_file=True) behaves the same. I haven't looked for other uses of SpooledTemporaryFile in Calibre.