报错信息:
Traceback (most recent call last):
File "/home/wwwroot/Spider/run.py", line 143, in <module>
Spider.run()
File "/home/wwwroot/Spider/run.py", line 53, in run
print u"[!] 休眠检查时间 %s" % CurrentTime()
UnicodeEncodeError: 'ascii' codec can't encode characters in position 4-7: ordinal not in range(128)
在 shell 中直接运行则无报错。爬了 Google 和 stackoverflow ,尝试过在 Supervisor 配置文件中添加下列内容,无效!依旧报错
environment=LANG="en_US.utf8", LC_ALL="en_US.UTF-8", LC_LANG="en_US.UTF-8"
最后 export LANG 依旧无效,代码中有有设置 #coding:utf-8 ,在 Windows 下运行正常, Linux 上 shell 运行也没问题,但是用 Supervisor 则报错。