Skip to content

Commit

Permalink
Return bytes in EpubHtml's get_body_content
Browse files Browse the repository at this point in the history
The method's documentation states that in python 3 it return bytes, but
was previously returning strings in some situations.
  • Loading branch information
joaoseckler committed Aug 7, 2024
1 parent e96c501 commit 269927e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ebooklib/epub.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -369,7 +369,7 @@ def get_body_content(self):

return tree_str

return ''
return six.b('')

def get_content(self, default=None):
"""
Expand Down

0 comments on commit 269927e

Please sign in to comment.