mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Don't die if temporary directory doesn't exist
This commit is contained in:
parent
24f3e635b2
commit
d41a9e891a
@ -334,6 +334,8 @@ class HTMLConverter(object):
|
|||||||
self.book.set_author(self.get_text(a))
|
self.book.set_author(self.get_text(a))
|
||||||
if self.verbose:
|
if self.verbose:
|
||||||
tdir = tempfile.gettempdir()
|
tdir = tempfile.gettempdir()
|
||||||
|
if not os.path.exists(tdir):
|
||||||
|
os.makedirs(tdir)
|
||||||
dump = open(os.path.join(tdir, 'html2lrf-verbose.html'), 'wb')
|
dump = open(os.path.join(tdir, 'html2lrf-verbose.html'), 'wb')
|
||||||
dump.write(unicode(soup).encode('utf-8'))
|
dump.write(unicode(soup).encode('utf-8'))
|
||||||
self.logger.info(_('Written preprocessed HTML to ')+dump.name)
|
self.logger.info(_('Written preprocessed HTML to ')+dump.name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user