私は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 キーが異なることだけです。