【Problem Description】
The following error occurred when using the scrapy framework today:
Traceback (most recent call last):
File "d:\anaconda\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "d:\anaconda\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:\anaconda\Scripts\scrapy.exe\__main__.py", line 9, in <module>
File "d:\anaconda\lib\site-packages\scrapy\cmdline.py", line 112, in execute
settings = get_project_settings()
File "d:\anaconda\lib\site-packages\scrapy\utils\project.py", line 64, in get_project_settings
init_env(project)
File "d:\anaconda\lib\site-packages\scrapy\utils\conf.py", line 85, in init_env
cfg = get_config()
File "d:\anaconda\lib\site-packages\scrapy\utils\conf.py", line 99, in get_config
cfg.read(sources)
File "d:\anaconda\lib\configparser.py", line 697, in read
self._read(fp, filename)
File "d:\anaconda\lib\configparser.py", line 1015, in _read
for lineno, line in enumerate(fp, start=1):
UnicodeDecodeError: 'gbk' codec can't decode byte 0xae in position 16: illegal multibyte sequence
This makes me puzzled. The error seems to be a coding problem, but my test case is very simple, and I am pretty sure that this coding error will not be reported...
【Solution】
Here is my solution. Of course, this problem may be caused by other problems. This is just a situation.
It's because I added Chinese comments in the configuration file... I am really convinced.
Remove the Chinese comment, this problem will be solved~