UnicodeEncodeError: 'gbk' codec
2018-10-19 本文已影响0人
徐振杰
可能是输出流中存在gbk导致python的print报错,
import sys
import io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf8')
其中TextIOWrapper用的应该是装饰者模式
可能是输出流中存在gbk导致python的print报错,
import sys
import io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf8')
其中TextIOWrapper用的应该是装饰者模式