python - How to close Boto S3 connection? -


I am using Boto to join Amazon S3 in my Python program. I am able to open a connection and upload files to a bucket. I thought I should close the connection to release resources and, more importantly, to avoid hanging an open connection to avoid any security risks. I think I should call the method () near. But I tested this as follows: 1. Open Connection 2. Close the connection 3. Upload the file to the bucket.

I thought phase 3 would fail, but the upload worked! So what does the closure () do? If it does not really close the connection, then what should I use in place of closing ()? Or is it unnecessary to close this connection?

I have not seen any luck, and, but yet, luck in reply.

Thank you for your help. Your Step 3 works because there is a beta code that will close the closed connection automatically and retry the requests on errors. It is very rare to achieve manually by closing the BOA connection because they are just HTTP connections and will be automatically closed after a few minutes of idle time. I do not care about trying to shut them down.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -