在将一个传统Django项目(基于Django 1.1)项目本地化为日语后,某些日志(并非全部)会在日语语言环境中输出如下所示的内容:
Traceback (most recent call last):
File "/home/deploy/.pythonbrew/pythons/Python-2.7/lib/python2.7/logging/__init__.py", line 838, in emit
msg = self.format(record)
File "/home/deploy/.pythonbrew/pythons/Python-2.7/lib/python2.7/logging/__init__.py", line 715, in format
return fmt.format(record)
File "/home/deploy/.pythonbrew/pythons/Python-2.7/lib/python2.7/logging/__init__.py", line 467, in format
s = self._fmt % record.__dict__
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)这可能是什么原因,并有避免这种情况的简单方法吗?如果没有,我怎么能更密切地研究这个问题,因为我甚至不知道哪些行调用失败的日志?提前致谢。