[Python] Boto3 appending x-amz-checksum-crc32 to raw body data

Discussão em 'Python' iniciado por Stack, Fevereiro 12, 2025.

  1. Stack

    Stack Membro Participativo

    When performing testing using boto3, checksum data was being added to the raw data in the S3 bucket. Boto3 version: 1.36.18.

    def add_file(cls, bucket: str = "test_bucket", body: str = "body", key: str = "key"):
    s3_client = boto3.client("s3")
    s3_client.put_object(Bucket=bucket, Key=key, Body=body)
    return key


    When the data is retrieved, checksum data is included.

    def get_object(cls, bucket_name: str = "test_bucket", file_name: str = "file.txt"):
    s3_client = boto3.client("s3")
    s3_object = s3_client.get_object(Bucket=bucket_name, Key=file_name)
    cls.body = s3_object["Body"].read().decode("utf-8")
    cls.metadata = s3_object["Metadata"]
    return cls


    This is causing my tests to fail.

    I have tried reducing the boto3 version to a lower 1.36 version but still have the same issues.

    Continue reading...

Compartilhe esta Página