mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
EPUB Input: Fix empty adobe page number template file causing conversion to fail. Fixes #1995551 [[Bug] Convert EPUB Fail (TypeError: cannot convert 'NoneType' object to bytes)](https://bugs.launchpad.net/calibre/+bug/1995551)
This commit is contained in:
parent
f77e2d693d
commit
58e506d0cd
@ -432,7 +432,7 @@ def serialize(data, media_type, pretty_print=False):
|
||||
if isinstance(data, str):
|
||||
data = data.encode('utf-8')
|
||||
return data + b'\n'
|
||||
return bytes(data)
|
||||
return b'' if data is None else bytes(data)
|
||||
|
||||
|
||||
ASCII_CHARS = frozenset(codepoint_to_chr(x) for x in range(128))
|
||||
|
Loading…
x
Reference in New Issue
Block a user