在读取使用logging.conf是报错:UnicodeDecodeError: 'gbk' codec can't decode byte 0xab in position 492: illegal multibyte sequence

报错信息:UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0xab in position 492: illegal multibyte sequence
有格式设置: args = (’./logs/test.log’, ‘a’, 10000, 3, ‘UTF-8’)

发一下具体报错的错误信息日志吧 不要只发一句话,缺少很多关键信息没办法直接判断

Traceback (most recent call last):
File “D:/工作文件/自动化/huogewiozi_test/pytest_test_data/logging_con_data.py”, line 3, in
logging.config.fileConfig(“logging.conf”)
File “E:\python\lib\logging\config.py”, line 69, in fileConfig
cp.read(fname)
File “E:\python\lib\configparser.py”, line 696, in read
self._read(fp, filename)
File “E:\python\lib\configparser.py”, line 1014, in _read
for lineno, line in enumerate(fp, start=1):
UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0xab in position 492: illegal multibyte sequence

关闭