From f154dcbc824dc343554b0d340a624f1af6705238 Mon Sep 17 00:00:00 2001 From: mathieui Date: Thu, 6 Apr 2017 23:26:59 +0200 Subject: Fix inline muc images --- poezio/xhtml.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'poezio/xhtml.py') diff --git a/poezio/xhtml.py b/poezio/xhtml.py index 8b191ad2..59c2ac7c 100644 --- a/poezio/xhtml.py +++ b/poezio/xhtml.py @@ -292,10 +292,10 @@ def parse_css(css): def trim(string): return re.sub(whitespace_re, ' ', string) -def get_hash(data: bytes) -> bytes: +def get_hash(data: bytes) -> str: # Currently using SHA-256, this might change in the future. # base64 gives shorter hashes than hex, so use that. - return b64encode(hashlib.sha256(data).digest()).rstrip(b'=') + return b64encode(hashlib.sha256(data).digest()).rstrip(b'=').decode() class XHTMLHandler(sax.ContentHandler): def __init__(self, force_ns=False, tmp_dir=None, extract_images=False): -- cgit v1.2.3