From 470d1c7280213e34e9ee7a3c778fa0f2751090a6 Mon Sep 17 00:00:00 2001 From: Jonathan Ehwald Date: Tue, 25 Nov 2025 11:33:05 +0100 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20Fix=20archive=20file=20was?= =?UTF-8?q?=20not=20closed=20after=20upload?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fastapi_cloud_cli/commands/deploy.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/fastapi_cloud_cli/commands/deploy.py b/src/fastapi_cloud_cli/commands/deploy.py index 9046a57..8540d69 100644 --- a/src/fastapi_cloud_cli/commands/deploy.py +++ b/src/fastapi_cloud_cli/commands/deploy.py @@ -182,11 +182,12 @@ def _upload_deployment(deployment_id: str, archive_path: Path) -> None: # Upload the archive logger.debug("Starting file upload to S3") - upload_response = client.post( - upload_data.url, - data=upload_data.fields, - files={"file": archive_path.open("rb")}, - ) + with open(archive_path, "rb") as archive_file: + upload_response = client.post( + upload_data.url, + data=upload_data.fields, + files={"file": archive_file}, + ) upload_response.raise_for_status() logger.debug("File upload completed successfully") From b28c464328a3f7d65861b65c5fd365ff4fb56a1c Mon Sep 17 00:00:00 2001 From: Patrick Arminio Date: Tue, 25 Nov 2025 11:02:32 +0000 Subject: [PATCH 2/2] Remove redundant comment --- src/fastapi_cloud_cli/commands/deploy.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/fastapi_cloud_cli/commands/deploy.py b/src/fastapi_cloud_cli/commands/deploy.py index 8540d69..dec422b 100644 --- a/src/fastapi_cloud_cli/commands/deploy.py +++ b/src/fastapi_cloud_cli/commands/deploy.py @@ -180,7 +180,6 @@ def _upload_deployment(deployment_id: str, archive_path: Path) -> None: upload_data = RequestUploadResponse.model_validate(response.json()) logger.debug("Received upload URL: %s", upload_data.url) - # Upload the archive logger.debug("Starting file upload to S3") with open(archive_path, "rb") as archive_file: upload_response = client.post(