我是 boto 的新手,我在这个链接上尝试了教程
http://boto.s3.amazonaws.com/s3_tut.html
但是,每次我尝试检索项目时都会发生错误。我的代码如下:
conn=boto.connect_s3(KEY,PRIVATEKEY)
bucket= conn.create_bucket(bucketname)
from boto.s3.Key import Key
k= Key(bucket,'key')
k.get_contents_to_file(filename)
我收到以下错误:
k.get_contents_to_file('test')
Traceback (most recent call last):
File "<pyshell#13>", line 1, in <module>
k.get_contents_to_file('test')
File "C:\Python33\lib\site-packages\boto\s3\key.py", line 1253, in get_contents_to_file
response_headers=response_headers)
File "C:\Python33\lib\site-packages\boto\s3\key.py", line 1149, in get_file
for bytes in self:
TypeError: iter() returned non-iterator of type 'Key'
我复制了代码几乎唯一的事情是我的 s3 密钥不同。