运行exitwp转换jeky帖子集合中的xml文件时出错

2024-04-27 15:02:35 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图通过对从Squarespace导出的xml文件运行exitwp从Squarespace迁移到jekyll。你知道吗

我收到这个错误:

writing.Traceback (most recent call last):
File "exitwp.py", line 371, in <module>
  write_jekyll(data, target_format)
File "exitwp.py", line 293, in write_jekyll
  i['date'], '%Y-%m-%d %H:%M:%S').replace(tzinfo=UTC()),
File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_strptime.py", line 325, in _strptime
  (data_string, format))
ValueError: time data 'No Content Found' does not match format '%Y-%m-%d %H:%M:%S'

你知道怎么修吗?你知道吗


Tags: 文件inpyformatdata错误linexml
2条回答

老问题,谷歌搜索同一条错误信息时发现的。你知道吗

在我从Squarespace导出的xml文件中,有许多页(<wp:post_type>page</wp:post_type>)缺少post_date标记。你知道吗

我只是在pubDate标记之后添加了它们,它在没有实际日期的情况下工作:

<pubDate>Sat, 05 May 2012 12:53:33 +0000</pubDate>
<wp:post_date>2012-05-05 12:53:33</wp:post_date>
<wp:post_date_gmt>2012-05-05 12:53:33</wp:post_date_gmt>

我刚刚提交了该错误的修复程序: https://github.com/thomasf/exitwp/pull/77

相关问题 更多 >