错误[Errno 11004]getaddrinfo从get_bucket方法失败?

2024-06-13 23:12:32 发布

您现在位置:Python中文网/ 问答频道 /正文

我在_socket.getaddrinfo(主机、端口、系列、类型、协议、标志)中的res中遇到错误:socket.gaierro:[Errno 11004]getaddrinfo在“conn.get_bucket”行上失败。虽然我成功地从“conn.get_all_bucket()”行获取了存储桶列表。你知道我为什么会犯这个错误吗

import boto3
from boto.s3.connection import S3Connection

accessKeyId = 'abc'
secretKey = 'xyz'
host = 'ecscloudstorage.asd.com'
port = 8080
signatureVersion = 's3'
accountType = 'S3 Compatible Storage'
bucketName ='testsomething'
# fileName = 'C:\\test1.txt'

conn = S3Connection(aws_access_key_id=accessKeyId,
            aws_secret_access_key=secretKey,
            host=host,
            port=port,
            is_secure=False)

print(conn.get_all_buckets())

my_bucket = conn.get_bucket(bucketName)
# print(my_bucket.name)

Tags: importhostgets3bucketport错误socket