Solution to scrapy output error log in win7 environment
Dec 07, 2016 am 09:22 AMWhen debugging scrapy code under win7, a code error occurs, but it is not output to the log. Instead, the following error is reported in cmd:
Traceback (most recent call last):
File "d:python27liblogging__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
Various attempts failed. Later, I found someone in the forum saying that this bug did not exist in the python3 environment, so I tried to upgrade the logging component of python2.7.
Shell code
pip install --upgrade logging
After upgrading logging, this error no longer appears.

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Scrapy implements crawling and analysis of WeChat public account articles

Scrapy case analysis: How to crawl company information on LinkedIn

Scrapy asynchronous loading implementation method based on Ajax

Scrapy optimization tips: How to reduce crawling of duplicate URLs and improve efficiency

Scrapy crawler practice: crawling QQ space data for social network analysis

In-depth use of Scrapy: How to crawl HTML, XML, and JSON data?

How does Scrapy implement Docker containerization and deployment?

How Scrapy improves crawling stability and crawling efficiency
