File tree 2 files changed +8
-0
lines changed
2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,10 @@ async def _request(
51
51
resp = exc .response .json ()
52
52
raise StorageApiError (resp ["message" ], resp ["error" ], resp ["statusCode" ])
53
53
54
+ # close the resource before returning the response
55
+ if files and "file" in files and isinstance (files ["file" ][1 ], BufferedReader ):
56
+ files ["file" ][1 ].close ()
57
+
54
58
return response
55
59
56
60
async def create_signed_upload_url (self , path : str ) -> SignedUploadURL :
Original file line number Diff line number Diff line change @@ -51,6 +51,10 @@ def _request(
51
51
resp = exc .response .json ()
52
52
raise StorageApiError (resp ["message" ], resp ["error" ], resp ["statusCode" ])
53
53
54
+ # close the resource before returning the response
55
+ if files and "file" in files and isinstance (files ["file" ][1 ], BufferedReader ):
56
+ files ["file" ][1 ].close ()
57
+
54
58
return response
55
59
56
60
def create_signed_upload_url (self , path : str ) -> SignedUploadURL :
You can’t perform that action at this time.
0 commit comments