mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-05 04:53:44 +02:00
Fix #1200 (mobi2oeb --verbose sometimes fails with UnicodeDecodeError)
This commit is contained in:
parent
4c5072d86f
commit
25d8697662
1 changed files with 4 additions and 1 deletions
|
|
@ -445,7 +445,10 @@ def main(args=sys.argv):
|
|||
mr.extract_content(opts.output_dir)
|
||||
if opts.verbose:
|
||||
oname = os.path.join(opts.output_dir, 'debug-raw.html')
|
||||
open(oname, 'wb').write(mr.mobi_html.encode('utf-8'))
|
||||
dat = mr.mobi_html
|
||||
if isinstance(dat, unicode):
|
||||
dat = dat.encode('utf-8')
|
||||
open(oname, 'wb').write(dat)
|
||||
print _('Raw MOBI HTML saved in'), oname
|
||||
|
||||
print _('OEB ebook created in'), opts.output_dir
|
||||
|
|
|
|||
Loading…
Reference in a new issue