我拆过的坑cycx

查询一下!

json.decoder.JSONDecodError:Unexpected UTF-8 BOM

做标签处理,读取的时候报错


源码:


json_path ‘classify_rule.json’

    with codecs.open(json_path, 'r', 'utf_8') as f:

        rule = json.load(f)

1

2

3

改为:


json_path ‘classify_rule.json’

    with codecs.open(json_path, 'r', 'utf_8_sig') as f:

        rule = json.load(f)

1

2

3

问题解决

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

Powered By Z-BlogPHP 1.7.3

Copyright Your WebSite.Some Rights Reserved.