mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Content server: Fix metadata not being written to all MOBI files. Fixes #923130 (failed to set metadata)
This commit is contained in:
parent
50c0f7f5b2
commit
53e89c8b04
@ -191,8 +191,14 @@ class SpooledTemporaryFile(tempfile.SpooledTemporaryFile):
|
|||||||
suffix = ''
|
suffix = ''
|
||||||
if dir is None:
|
if dir is None:
|
||||||
dir = base_dir()
|
dir = base_dir()
|
||||||
tempfile.SpooledTemporaryFile.__init__(self, max_size=max_size, suffix=suffix,
|
tempfile.SpooledTemporaryFile.__init__(self, max_size=max_size,
|
||||||
prefix=prefix, dir=dir, mode=mode, bufsize=bufsize)
|
suffix=suffix, prefix=prefix, dir=dir, mode=mode,
|
||||||
|
bufsize=bufsize)
|
||||||
|
|
||||||
|
def truncate(self, *args):
|
||||||
|
# The stdlib SpooledTemporaryFile implementation of truncate() doesn't
|
||||||
|
# allow specifying a size.
|
||||||
|
self._file.truncate(*args)
|
||||||
|
|
||||||
def better_mktemp(*args, **kwargs):
|
def better_mktemp(*args, **kwargs):
|
||||||
fd, path = tempfile.mkstemp(*args, **kwargs)
|
fd, path = tempfile.mkstemp(*args, **kwargs)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user