Commit 62fc6681 authored by Florian Schulze's avatar Florian Schulze

Fix documentation upload by fixing content_type in _build_multipart on Python 3.x.

parent c4ff7cc6
......@@ -138,7 +138,7 @@ class upload_docs(upload):
part_groups = map(builder, data.items())
parts = itertools.chain.from_iterable(part_groups)
body_items = itertools.chain(parts, end_items)
content_type = 'multipart/form-data; boundary=%s' % boundary
content_type = 'multipart/form-data; boundary=%s' % boundary.decode('ascii')
return b''.join(body_items), content_type
def upload_file(self, filename):
......
......@@ -64,6 +64,8 @@ class TestUploadDocsTest:
)
body, content_type = upload_docs._build_multipart(data)
assert 'form-data' in content_type
assert "b'" not in content_type
assert 'b"' not in content_type
assert isinstance(body, bytes)
assert b'foo' in body
assert b'content' in body
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