win7下调试scrapy代码时,出现代码报错,但是未输出到log日志,而是在cmd中报如下错误:
Traceback (most recent call last):
File "d:\python27\lib\logging\__init__.py", line 884, in emit
stream.write(fs % msg.encode("UTF-8"))
UnicodeDecodeError: 'gbk' codec can't decode bytes in position 1274-1275: illegal multibyte sequence
Logged from file scraper.py, line 158
各种尝试均告失败,后来在论坛中发现有人说这个bug在python3环境不存在,于是尝试升级python2.7的logging组件。
Shell代码
pip install --upgrade logging
升级logging后再无此报错出现。