View Single Post
Old 12-17-2019, 04:14 PM   #18
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 7,038
Karma: 4604637
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
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.
JimmXinu is offline   Reply With Quote