如何纠正ConnectionError:“连接异常终止”。通过Boto3读取S3存储桶时?

时间:2019-04-22 13:49:12

标签: python boto3

我正在尝试通过Boto3读取S3存储桶,但出现此错误:

  

提高ConnectionError(err,request = request)   botocore.vendored.requests.exceptions.ConnectionError :(“连接已中止。”,ConnectionResetError(10054,“远程主机强行关闭了现有连接”,无,10054,无))

import boto3

s3 =boto3.client('s3',aws_access_key_id='KEY',aws_secret_access_key='SECRET_KEY')

# Call S3 to list current buckets
response = s3.list_buckets()

# Get a list of all bucket names from the response
buckets = [bucket['Name'] for bucket in response['Buckets']]

# Print out the bucket list
print("Bucket List: %s" % buckets)

0 个答案:

没有答案