在使用 pygal 时,plot_dict
里指定了一个description的label,在运行时报错了,错误信息是:
AttributeError: ‘NoneType’ object has no attribute ‘decode’
原因:
It seems the data you got before hasn’t clarifed the type of value that ‘description’ storged.
解决办法:
Try str() like ’label’:str(repo_dict[‘description’])
参考:
python 3.x - AttributeError: ‘NoneType’ object has no attribute ‘decode’ - Stack Overflow