Skip to content

S3 object does not always have a content type #331

@georgeboot

Description

@georgeboot

Cloudpathlib expects all s3 objects to have a content type, however this is not always the case as content-type is not a required field and is part of the objects optional metadata. Please review https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingMetadata.html#object-metadata

Please review the below code:
https://github.com/drivendataorg/cloudpathlib/blob/28b2eb5dbba3ba5477284e1b432ac723f1a87f1b/cloudpathlib/s3/s3client.py#LL145C9-L145C49

This will result in a KeyError on that specific line.

From what I have seen, the content type is not even used by cloudpathlib, so my vote would be to ditch it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions