TypeError:强制转换为Unicode:需要字符串或缓冲区,在python中找到dict

时间:2016-07-15 16:21:26

标签: python unicode

这是我的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  

0 个答案:

没有答案