LIT Output: Fix regression in 3.41 caused by py3 porting that broke conversion of some files to LIT. Fixes #1837561 [Lit conversion error (Conversion options changed from default)](https://bugs.launchpad.net/calibre/+bug/1837561)

This commit is contained in:
Kovid Goyal 2019-07-23 20:08:12 +05:30
parent 9210902218
commit 80c6de0eb9
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -721,6 +721,8 @@ class LitWriter(object):
dchunks.append(dchunk.getvalue()) dchunks.append(dchunk.getvalue())
dcounts.append(dcount) dcounts.append(dcount)
if ichunk: if ichunk:
if not isinstance(name, bytes):
name = name.encode('utf-8')
ichunk.write(decint(len(name))) ichunk.write(decint(len(name)))
ichunk.write(name) ichunk.write(name)
ichunk.write(decint(cid)) ichunk.write(decint(cid))