Search code examples
pythonpython-3.xpippelican

How do I import my Google Blogger files into Pelican without getting errors?


I can't import my Blogger files in the feed.atom file format into Pelican without some kind of Python error. I installed BeautifulSoup4, lxml, feedparser, and pandoc but I keep getting other errors appear such as the one below:

[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'

I run a RedHat derivative if that helps any. I'm also not sure if I'm supposed to be using the --feed or --blogger parameter when making the call to parse my feed.atom Blogger file.


Solution

  • This seems like a bug in pelican-import. feedparser's date/time parser returns the result of datetime.utctimetuple() which is time.struct_time instance while pelican-import expects an object with .strftime() method.

    Report the bug to the Pelican tracker.