其他分享
首页 > 其他分享> > UnicodeDecodeError: 'gbk' codec can't decode byte 0xaf in position 68: illegal multib

UnicodeDecodeError: 'gbk' codec can't decode byte 0xaf in position 68: illegal multib

作者:互联网

 

import yaml
def test_yaml():
    f = open('C:\hogwarts\Scripts\hogwarts-api\demo\yaml_data.yml')
    print(yaml.load(f))  

# 改进:
import yaml
def test_yaml():
f = open('C:\hogwarts\Scripts\hogwarts-api\demo\yaml_data.yml','rb')
print(yaml.load(f))

标签:load,sequence,api,0xaf,multibyte,yaml,hogwarts,demo,open
来源: https://www.cnblogs.com/Uni-Hoang/p/12903733.html