Skip to content
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

S3 same ExtraArgs for upload_fileobj and get_object in method copy #331

Open
MarchenkoRoman opened this issue Apr 19, 2024 · 1 comment
Open

Comments

@MarchenkoRoman
Copy link

MarchenkoRoman commented Apr 19, 2024

  • Async AWS SDK for Python version: 12.4.0
  • Python version: 3.10
  • Operating System: 20.04.1-Ubuntu

Description

I tried to copy file object in S3 using copy method, but found get_object and upload_fileobj in method used the same ExtraArgs, but according to boto3 documentation https://boto3.amazonaws.com/v1/documentation/api/latest/reference/customizations/s3.html#boto3.s3.transfer.S3Transfer its must be different

I think better use different ExtraArgs for get_object and upload_fileobj when its use in copy method
for example:

     async with s3_client as s3:
         await s3.copy(
             CopySource={'Bucket': settings.S3.BUCKET, 'Key': key},
             Bucket=settings.S3.BUCKET,
             Key='new_tmp/' + key,
             ExtraArgs={'ACL': 'public-read'}
         )

will raise

ParamValidationError: Parameter validation failed:
Unknown parameter in input: "ACL", must be one of: Bucket, IfMatch, IfModifiedSince, IfNoneMatch, IfUnmodifiedSince, Key, Range, ResponseCacheControl, ResponseContentDisposition, ResponseContentEncoding, ResponseContentLanguage, ResponseContentType, ResponseExpires, VersionId, SSECustomerAlgorithm, SSECustomerKey, SSECustomerKeyMD5, RequestPayer, PartNumber, ExpectedBucketOwner, ChecksumMode

@terricain
Copy link
Owner

Try v13.0.0 this should be resolved now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants