Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
Replace StringIO with ByteIO
Browse files Browse the repository at this point in the history
Flask on python3 won't work with StringIO

Signed-off-by: SolidifiedRay <[email protected]>
  • Loading branch information
SolidifiedRay committed Jul 7, 2020
1 parent 3a4f026 commit c7c42c2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
import os
import uuid
import time
import StringIO
import io
import tarfile

from functools import wraps
Expand Down Expand Up @@ -1044,8 +1044,8 @@ def download_layout():
layout_metadata = in_toto.models.metadata.Metablock(signed=layout)

# Dump layout to memory file and server to user
layout_fp = StringIO.StringIO()
layout_fp.write("{}".format(layout_metadata))
layout_fp = io.BytesIO()
layout_fp.write(("{}".format(layout_metadata)).encode())
layout_fp.seek(0)
return send_file(layout_fp,
mimetype="application/json", as_attachment=True,
Expand Down

0 comments on commit c7c42c2

Please sign in to comment.