我最近更新了 python-pelican 版本 3.5.0。之后我就没有进行生成。错误如下:
ERROR: Could not process linux/ssh.md
| can't compare offset-naive and offset-aware datetimes
|___
| Traceback (most recent call last):
| File "/usr/local/lib/python2.7/dist-packages/pelican/generators.py", line 502, in generate_context
| context_sender=self)
| File "/usr/local/lib/python2.7/dist-packages/pelican/readers.py", line 492, in read_file
| context=context)
| File "/usr/local/lib/python2.7/dist-packages/pelican/contents.py", line 136, in __init__
| if hasattr(self, 'date') and self.date > SafeDatetime.now():
| TypeError: can't compare offset-naive and offset-aware datetimes
我已经更新了所有插件,但没有效果。
升级之前版本是3.3.0,运行良好。
请帮忙,如何解决?
(如果有错误,抱歉,是谷歌翻译的)
最佳答案
我也遇到了同样的错误。我设法通过在 publishconf.py
中注释选项 WITH_FUTURE_DATES = False
来解决这个问题。
我没有进一步调查,所以我还不知道问题的确切原因。
关于python - 使用 python-pelican 生成网站时出现错误 "can' t 比较原始偏移和偏移感知日期时间”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27087543/