如何将我的Google Blogger文件导入Pelican而不会出现错误?

时间:2018-12-13 04:22:31

标签: python python-3.x pip pelican

没有某种Python错误,我无法将feed.atom文件格式的Blogger文件导入Pelican。我安装了BeautifulSoup4lxmlfeedparserpandoc,但是我不断出现其他错误,例如以下错误:

[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文件的调用时是否应该使用--bloggerfeed.atom参数。

1 个答案:

答案 0 :(得分:2)

这似乎是pelican-import中的错误。 feedparser的日期/时间解析器returnstime.struct_time实例datetime.utctimetuple()的结果,而pelican-import expects是带有{{1}的对象}方法。

将错误报告给the Pelican tracker