S3 giving me NoSuchKey error even when the key exists

前端 未结 5 1011
野的像风
野的像风 2021-02-13 01:15

This is my boto3 command for getting the object with a specific key from an S3 bucket:

resp = s3client.get_object(Bucket=\'<>-<>\', Key=\'MzA1MjY1Nzkz         


        
5条回答
  •  深忆病人
    2021-02-13 01:58

    from urllib.parse import unquote
    key = "MzA1MjY1NzkzX2QudHh0%0A"
    
    key = unquote(key)
    

    This will remove all special characters from any key.

提交回复
热议问题