From 99ea478f07e1245d8fd6a268647086a8691b7385 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ebooklib/epub.py b/ebooklib/epub.py index 62fea67..12b3291 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): """ @@ -395,7 +395,7 @@ def get_content(self, default=None): try: html_tree = parse_html_string(self.content) except: - return '' + return six.b('') html_root = html_tree.getroottree()