在用python3.7.4+requests+allure+pytest框架运行接口自动化脚本时,报了如下错误:
经过百度后,找到解决方法:
将/home/zhangxiaolin/.pyenv/versions/3.7.4/lib/python3.7/site-packages/allure_commons/logger.py文件中的attached_file.write(body.encode('utf-8'))方法改为 attached_file.write(body.encode('utf-8',errors='surrogatepass'))