summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2017-04-06 23:26:59 +0200
committermathieui <mathieui@mathieui.net>2017-04-06 23:26:59 +0200
commitf154dcbc824dc343554b0d340a624f1af6705238 (patch)
treea62548bca91a968f774b092dc349b5d8c654d044
parent2406204d1cf4b9c3a8583b2d03e8935a6e57c453 (diff)
downloadpoezio-f154dcbc824dc343554b0d340a624f1af6705238.tar.gz
poezio-f154dcbc824dc343554b0d340a624f1af6705238.tar.bz2
poezio-f154dcbc824dc343554b0d340a624f1af6705238.tar.xz
poezio-f154dcbc824dc343554b0d340a624f1af6705238.zip
Fix inline muc images
-rw-r--r--poezio/xhtml.py4
1 files changed, 2 insertions, 2 deletions
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):