mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-27 14:24:12 +02:00
Don't die if writing to html2lrf-verbose fails.
This commit is contained in:
parent
f87dbae162
commit
b4c8cd9264
1 changed files with 7 additions and 4 deletions
|
|
@ -336,10 +336,13 @@ def preprocess(self, raw):
|
|||
tdir = tempfile.gettempdir()
|
||||
if not os.path.exists(tdir):
|
||||
os.makedirs(tdir)
|
||||
dump = open(os.path.join(tdir, 'html2lrf-verbose.html'), 'wb')
|
||||
dump.write(unicode(soup).encode('utf-8'))
|
||||
self.logger.info(_('Written preprocessed HTML to ')+dump.name)
|
||||
dump.close()
|
||||
try:
|
||||
dump = open(os.path.join(tdir, 'html2lrf-verbose.html'), 'wb')
|
||||
dump.write(unicode(soup).encode('utf-8'))
|
||||
self.logger.info(_('Written preprocessed HTML to ')+dump.name)
|
||||
dump.close()
|
||||
except:
|
||||
pass
|
||||
|
||||
return soup
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue