Skip to content

Commit e4454d4

Browse files
committed
streaming upload fix
1 parent 7b961ce commit e4454d4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/sindri/sindri.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,11 @@ def create_circuit(
406406
# Create a tar archive and upload via byte stream
407407
circuit_upload_path = os.path.abspath(circuit_upload_path)
408408
file_name = f"{pathlib.Path(circuit_upload_path).stem}.tar.gz"
409-
fh = io.BytesIO()
410-
with tarfile.open(fileobj=fh, mode="w:gz") as tar:
411-
tar.add(circuit_upload_path, arcname=file_name)
412-
files = {"files": fh.getvalue()} # type: ignore
409+
with open(file_name, "wb") as fh:
410+
with tarfile.open(fileobj=fh, mode="w:gz") as tar:
411+
tar.add(circuit_upload_path, arcname=file_name)
412+
fh = open(file_name, "rb")
413+
files = {"files": fh}
413414

414415
data = {
415416
"tags": tags,

0 commit comments

Comments
 (0)