File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
src/fastapi_cloud_cli/commands Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -193,13 +193,13 @@ def _upload_deployment(deployment_id: str, archive_path: Path) -> None:
193193 upload_data = model_validate (RequestUploadResponse , response .json ())
194194 logger .debug ("Received upload URL: %s" , upload_data .url )
195195
196- # Upload the archive
197196 logger .debug ("Starting file upload to S3" )
198- upload_response = client .post (
199- upload_data .url ,
200- data = upload_data .fields ,
201- files = {"file" : archive_path .open ("rb" )},
202- )
197+ with open (archive_path , "rb" ) as archive_file :
198+ upload_response = client .post (
199+ upload_data .url ,
200+ data = upload_data .fields ,
201+ files = {"file" : archive_file },
202+ )
203203
204204 upload_response .raise_for_status ()
205205 logger .debug ("File upload completed successfully" )
You can’t perform that action at this time.
0 commit comments