mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
HTMLZ Output: Fix long title causing error on windows
HTMLZ Output: Fix long titles causing error when converting on windows. Fixes #1235815 [Long titles with possible invalid chars cause errors during convert](https://bugs.launchpad.net/calibre/+bug/1235815)
This commit is contained in:
parent
593d5174bf
commit
a117d4c0b6
@ -67,7 +67,8 @@ class HTMLZOutput(OutputFormatPlugin):
|
|||||||
|
|
||||||
fname = u'index'
|
fname = u'index'
|
||||||
if opts.htmlz_title_filename:
|
if opts.htmlz_title_filename:
|
||||||
fname = ascii_filename(unicode(oeb_book.metadata.title[0]))
|
from calibre.utils.filenames import shorten_components_to
|
||||||
|
fname = shorten_components_to(100, (ascii_filename(unicode(oeb_book.metadata.title[0])),))[0]
|
||||||
with open(os.path.join(tdir, fname+u'.html'), 'wb') as tf:
|
with open(os.path.join(tdir, fname+u'.html'), 'wb') as tf:
|
||||||
tf.write(html)
|
tf.write(html)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user