From 269927e903fc0855bd23472dc4b31dec6fb6f22d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Seckler?= Date: Wed, 7 Aug 2024 16:50:22 -0300 Subject: [PATCH] Return bytes in EpubHtml's get_body_content The method's documentation states that in python 3 it return bytes, but was previously returning strings in some situations. --- ebooklib/epub.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ebooklib/epub.py b/ebooklib/epub.py index 62fea67..7bde55d 100644 --- a/ebooklib/epub.py +++ b/ebooklib/epub.py @@ -352,7 +352,7 @@ def get_body_content(self): try: html_tree = parse_html_string(self.content) except: - return '' + return six.b('') html_root = html_tree.getroottree() @@ -369,7 +369,7 @@ def get_body_content(self): return tree_str - return '' + return six.b('') def get_content(self, default=None): """