robot framework的log中Unicode编码改中文
2019-04-27 本文已影响0人
LeslieFind
博客:https://blog.csdn.net/huashao0602/article/details/55045719
step1:
进入D:\work files\Python27\Lib\site-packages\robot\utils目录
step2:
\unic.py文件中增加
1、引入json库:import json
2、
if isinstance(item, (list, dict, tuple)):
try:
item = json.dumps(item, ensure_ascii=False, encoding='cp936')
except UnicodeDecodeError:
try:
item = json.dumps(item, ensure_ascii=False, encoding='cp936')
except:
pass
except:
pass
image.png