且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Python无法使用额外的结尾逗号来解析JSON

更新时间:2022-06-16 10:47:16

JSON规范不允许尾随逗号.解析器抛出异常,因为它遇到无效的语法标记.

JSON specification doesn't allow trailing comma. The parser is throwing since it encounters invalid syntax token.

您可能会对这些文件使用其他解析器感兴趣,例如.为 JSON5规范构建的解析器,它允许这种语法.

You might be interested in using a different parser for those files, eg. a parser built for JSON5 spec which allows such syntax.