错误信息:
UnicodeEncodeError: 'ascii' codec can't encode characters in position 33-34: ordinal not in range(128)
解决:指定encoding
# 创建一个handler,用于写入日志文件
fh = logging.FileHandler(logname, encoding='utf-8')
fh.setLevel(loglevel)
错误信息:
UnicodeEncodeError: 'ascii' codec can't encode characters in position 33-34: ordinal not in range(128)
解决:指定encoding
# 创建一个handler,用于写入日志文件
fh = logging.FileHandler(logname, encoding='utf-8')
fh.setLevel(loglevel)