mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Don't die if writing to html2lrf-verbose fails.
This commit is contained in:
parent
f87dbae162
commit
b4c8cd9264
@ -336,10 +336,13 @@ class HTMLConverter(object):
|
|||||||
tdir = tempfile.gettempdir()
|
tdir = tempfile.gettempdir()
|
||||||
if not os.path.exists(tdir):
|
if not os.path.exists(tdir):
|
||||||
os.makedirs(tdir)
|
os.makedirs(tdir)
|
||||||
|
try:
|
||||||
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)
|
||||||
dump.close()
|
dump.close()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
return soup
|
return soup
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user