-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document that s3 upload_fileobj closes the file obj #3150
Comments
Hi @mdavis-xyz thanks for reaching out. This was reported awhile ago in another issue (#929) and an issue was created in the s3transfer repository to address it: boto/s3transfer#80. I’m going to close this as a duplicate and we can continue to track this in the s3transfer issue. |
|
@tim-finnigan I don't think this ticket should be closed. The issue is that the documentation for boto3 does not mention an unintuitive behavior of boto3. That's still an issue. Those other Github issues for other repositories won't fix that doc issue for this repository. As an end user it has never been clear to me what the difference is between botocore, s3transfer and boto3. (Perhaps that's the doc change that's required?) I don't think it's reasonable to assume that users will think to look deep into the docs of 2 dependencies of boto3 to find this behavior. But if they did, they still wouldn't find it, because that's not what those other issues are for. That 80 issue in botocore has remained open for half a decade. I don't think that's going to change any time soon. It's not even clear what that issue is about. (is it about changing the docs to describe the file closing behavior, or changing the behavior to not close the file?) If I submit a PR to just add one sentence to the boto3 docs, will you accept it? |
Hi @mdavis-xyz thanks for following up. I brought this up for discussion with the team and they agreed that a short reference to this behavior could be added to the documentation if you want to create a PR. There is still some debate over whether the s3transfer issue should be considered a bug. But someone did share a workaround here in the comments. |
Greetings! It looks like this issue hasn’t been active in longer than five days. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one. |
Where should I put the comments? Because Boto3 is programmatically generated from the service definition files, I find it incredibly hard to navigate the codebase and find out where anything is, or how it works. |
Not sure how PR notifications work, just wanted to quickly mention I added a PR updating the docs (that hopefully closes this issue) @tim-finnigan #3968 |
When I look at the documentation for functions like
upload_fileobj
, it's not clear that boto3 will close the file for me.I have a use case where I have a zip file in a BytesIO, I want to upload it and unzip it.
I assumed boto wouldn't close the file for me, but it does.
That's fine, since the code unzipping this won't close it, so I can just swap the order.
But the documentation should clarify what the behavior is, right there where it explains that the argument is a file-like object.
e.g.
The text was updated successfully, but these errors were encountered: