没有某种Python错误,我无法将feed.atom
文件格式的Blogger文件导入Pelican。我安装了BeautifulSoup4
,lxml
,feedparser
和pandoc
,但是我不断出现其他错误,例如以下错误:
[root@web blog]# pelican-import --feed -m MARKUP -o /var/www/blog/content/ /home/<user>/Blogger/Blogs/test/feed.atom
WARNING: Pandoc version unknown: FileNotFoundError: [Errno 2] No such file or directory: 'pandoc': 'pandoc'
WARNING: Feeds generated without SITEURL set properly may not be valid
WARNING: No timezone information specified in the settings. Assuming your timezone is UTC for feed generation. Check http://docs.getpelican.com/en/latest/settings.html#timezone for more information
Traceback (most recent call last):
File "/usr/local/bin/pelican-import", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/site-packages/pelican/tools/pelican_import.py", line 1019, in main
attachments=attachments or None)
File "/usr/local/lib/python3.7/site-packages/pelican/tools/pelican_import.py", line 780, in fields2pelican
kind, in_markup) in fields:
File "/usr/local/lib/python3.7/site-packages/pelican/tools/pelican_import.py", line 567, in feed2fields
if hasattr(entry, 'updated_parsed') else None)
AttributeError: 'time.struct_time' object has no attribute 'strftime'
如果有帮助,我可以运行RedHat
衍生产品。我也不确定在调用解析--feed
Blogger文件的调用时是否应该使用--blogger
或feed.atom
参数。
答案 0 :(得分:2)
这似乎是pelican-import
中的错误。 feedparser
的日期/时间解析器returns是time.struct_time
实例datetime.utctimetuple()的结果,而pelican-import
expects是带有{{1}的对象}方法。
将错误报告给the Pelican tracker。