首页 > 技术文章 > python TypeError: Object of type 'Decimal' is not JSON serializable

chiliu 2021-08-06 11:48 原文

这个问题提示

类型为'Decimal'的对象不是JSON可序列化的

是因为我在写入字典时 value值是Decimal类型 

把类型强转后即可解决

 

mac本地没问题。发不到liunx上就提示这个错误

因每个系统的进制是不一样的 

 

推荐阅读