解决《Python编程:从入门到实践》17章中的一个报错:“At
2019-03-11 本文已影响0人
博士伦2014
《Python编程:从入门到实践》第17章,349页:

在输完上图代码之后运行代码后,报错如下:
metadata['label'])
return string.decode('utf-8')
AttributeError: 'NoneType' object has no attribute 'decode'
”空类型“对象没有属性“decode”
应该是label属性 期望是个字符串
将上图中箭头所指的那一行改为:
'label':str(respon_dic['description'])
加油!