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))
上一篇:git文件上传vscode vue启动报错:no version of chokidar is available.Tried chokidar@2 and chokidar@3


下一篇:解决 UnicodeEncodeError: 'gbk' codec can't encode character '\u2714' in posi