这是我的boto3代码。我在AS中获得了yaml输出。我无法弄清楚这个错误。我的代码有什么问题。感谢帮助。
doc = ''
AS = conn.describe_auto_scaling_instances(InstanceIds=[i.id])
with open(AS,'r') as file:
doc = yaml.load(file)
print doc
错误:
Traceback (most recent call last):
File "C:/Users/mvadaria/PycharmProjects/lambdaEC2/ec2autoshutAS.py", line 21, in <module>
with open(AS,'r') as file:
TypeError: coercing to Unicode: need string or buffer, dict found