Python 修复Pelican RSS源中的验证错误

Python 修复Pelican RSS源中的验证错误,python,rss,pelican,Python,Rss,Pelican,我正在使用RSS源生成博客。但是,通过W3C的提要验证程序运行RSS提要会引发以下错误: guid must be a full URL, unless isPermaLink attribute is false 其中一条令人反感的台词是 <guid>tag:foo,2013-08-07:bar.html</guid> 标签:foo,2013-08-07:bar.html Pelican似乎使用了,但我找不到任何相关的配置选项 我应该如何解决这个问题?我认为解决方

我正在使用RSS源生成博客。但是,通过W3C的提要验证程序运行RSS提要会引发以下错误:

guid must be a full URL, unless isPermaLink attribute is false
其中一条令人反感的台词是

<guid>tag:foo,2013-08-07:bar.html</guid>
标签:foo,2013-08-07:bar.html Pelican似乎使用了,但我找不到任何相关的配置选项


我应该如何解决这个问题?

我认为解决方案是修改、更改:

handler.addQuickElement("guid", item['unique_id'])
…致:

handler.addQuickElement('guid isPermaLink="false"', item['unique_id'])

RSS已经有了
链接
属性
feedgenerator
当前假定
unique\u id
是一个URL,不应这样做。我怀疑这是解决这个问题的最好办法。

我认为贾斯汀·梅尔的答案是试图做正确的事情,但并不完全正确。至少,使用Pelican 3.6.3和feedgenerator 1.7,该修复程序会生成格式不正确的XML:

<guid isPermaLink="false"> ... </guid isPermaLink="false">
(版本1.7中feedgenerator.py的第283行)至:

这将Pelican为我生成的无效RSS转换为在上正确验证的RSS

handler.addQuickElement("guid", item['unique_id'])
handler.addQuickElement('guid', item['unique_id'],
                        attrs={"isPermaLink": "false"})