技术笔记
python报错误:json.decoder.JSONDecodeError: Unexpected UTF-8 BOM (decode using utf-8-sig)
 moons   2021-04-17 09:59:43   182
专栏分类: python
报错的源码
python
json_path 'classify_rule.json'
    with codecs.open(json_path, 'r', 'utf-8') as f:
        rule = json.load(f)


修改后为:
python
json_path 'classify_rule.json'
    with codecs.open(json_path, 'r', 'utf-8-sig') as f:
        rule = json.load(f)
Copyright © mos360.cn By Moons Soft Studio 百度统计