jhao104 / proxy_pool

Python ProxyPool for web spider
https://jhao104.github.io/proxy_pool/
MIT License
21.48k stars 5.17k forks source link

centos下运行会有中文编码问题,删除整个项目里的中文后,问题依旧存在 #206

Closed TeavenX closed 2 years ago

TeavenX commented 5 years ago

UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 106: ordinal not in range(128)

jhao104 commented 5 years ago

UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 106: ordinal not in range(128)

配置文件不能有中文

TeavenX commented 5 years ago

我把中文全都删了 还是不行,整个项目里的中文

jhao104 commented 5 years ago

我把中文全都删了 还是不行,整个项目里的中文

那麻烦贴下完整日志

liangpengfei commented 5 years ago

Process RefreshRun: Traceback (most recent call last): File "/usr/lib/python3.5/multiprocessing/process.py", line 249, in _bootstrap self.run() File "/usr/lib/python3.5/multiprocessing/process.py", line 93, in run self._target(*self._args, **self._kwargs) File "../Schedule/ProxyRefreshSchedule.py", line 103, in run fetch_all() File "../Schedule/ProxyRefreshSchedule.py", line 93, in fetch_all p = ProxyRefreshSchedule() File "../Schedule/ProxyRefreshSchedule.py", line 41, in init ProxyManager.init(self) File "../Manager/ProxyManager.py", line 33, in init self.db = DbClient() File "../DB/DbClient.py", line 58, in init self.config = GetConfig() File "../Util/GetConfig.py", line 30, in init self.config_file.read(self.config_path) File "/usr/lib/python3.5/configparser.py", line 696, in read self._read(fp, filename) File "/usr/lib/python3.5/configparser.py", line 1012, in _read for lineno, line in enumerate(fp, start=1): File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 106: ordinal not in range(128)

ubuntu也有这个问题。。

jhao104 commented 5 years ago

@liangpengfei 你这个报错也是 Config.ini里面有中文字符串。 另外别在win上用记事本打开,它会加个编码头