Resource Warning - unclosed SSL #3748
Answered
by
tim-finnigan
rickerish-nah
asked this question in
Q&A
-
Issue: [ResourceWarning: unclosed ssl.SSLSocket] (#454 (comment)) is it possible to use the s3 client as/within a context manager? this way we can resolve the close() issue for respective usage specifically but not close down on all other parallel sessions or decrease in performance |
Beta Was this translation helpful? Give feedback.
Answered by
tim-finnigan
Jun 20, 2023
Replies: 1 comment
-
Hi @rickerish-nah there is an example here in that issue you linked of wrapping the s3 client with the closing context manager: from contextmanager import closing
with closing(boto3.client(service_name='s3')) as client:
buckets = client.list_buckets() |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
RyanFitzSimmonsAK
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @rickerish-nah there is an example here in that issue you linked of wrapping the s3 client with the closing context manager: