Commit 464cccf4 authored by Jérome Perrin's avatar Jérome Perrin

web: py3 WIP

parent f8b48e8f
......@@ -270,7 +270,7 @@ def handleLinkedData(mime, data, href):
"mime_type": mime,
"encode": "quoted-printable" if mime.startswith("text/") else None,
"add_header_list": [("Content-Location", url)],
"data": str(data),
"data": bytes(data),
})
return url
else:
......@@ -335,7 +335,7 @@ def replaceFromDataUri(data_uri, replacer):
data = b64decode(data)
if not is_base64:
data = replacer(data)
return "%s,%s" % (header, b64encode(data) if is_base64 else data)
return "%s,%s" % (header, b64encode(data).decode() if is_base64 else data)
def extractUrlSearch(url):
url = url.split("#", 1)[0].split("?", 1)
......
......@@ -80,7 +80,7 @@ def encode_quopri(msg):
when necessary.
"""
orig = msg.get_payload()
encdata = quopri.encodestring(orig.encode()).replace("=\n", "=\r\n")
encdata = quopri.encodestring(orig.encode()).replace(b"=\n", b"=\r\n")
msg.set_payload(encdata)
msg.add_header("Content-Transfer-Encoding", "quoted-printable")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment