我正在使用botoPython中的库连接到DynamoDB.以下代码对我来说很好:
import boto
key = 'abc'
secret = '123'
con = boto.connect_dynamodb(key,secret)
table = con.get_table('Table Name')
-- rest of code --
Run Code Online (Sandbox Code Playgroud)
当我尝试连接到特定区域时,我可以很好地连接,但让表格正常工作会引发错误:
import boto
from boto.ec2.connection import EC2Connection
key = 'abc'
secret = '123'
regions = EC2Connection(key,secret).get_all_regions() # some filtering after this line to remove unwanted entries
for r in regions:
con = boto.connect_dynamodb(key,secret,region=r)
table = con.get_table('Table Name') # throws the error below
-- rest of code --
Run Code Online (Sandbox Code Playgroud)
使用上面的第二个代码块,我得到一个ValueError: No JSON object could be decoded.调用con.list_tables() …