Skip to content

Document that s3 upload_fileobj closes the file obj #3150

Open
@mdavis-xyz

Description

@mdavis-xyz

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.

Fileobj (a file-like object) -- A file-like object to upload. At a minimum, it must implement the read method, and must return bytes. This function will have .close() called on it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationThis is a problem with documentation.feature-requestThis issue requests a feature.p2This is a standard priority issues3

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions