1
0
Fork 0

Adding patch from Lars Kellogg-Stedman <lars@oddbit.com> to fix links in atom feeds.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-05 07:43:48 +01:00
parent c42685d825
commit 6ac7a64d19
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
2 changed files with 39 additions and 0 deletions

View file

@ -0,0 +1,38 @@
Author: Lars Kellogg-Stedman <lars@oddbit.com>
Subject: Fix handling of links in atom feeds
The existing code iterated over entry links like this:
.
for link in self.__atom_link or []:
link = xml_elem('link', entry, href=link['href'])
.
The first line in the loop overwrites the `link` variable, rendering the
rest of the loop a no-op. This commit corrects the situation by creating a
new variable rather than overwriting the loop variable.
diff -Naurp python-feedgen.orig/feedgen/entry.py python-feedgen/feedgen/entry.py
--- python-feedgen.orig/feedgen/entry.py
+++ python-feedgen/feedgen/entry.py
@@ -137,17 +137,17 @@ class FeedEntry(object):
_add_text_elm(entry, self.__atom_content, 'content')
for link in self.__atom_link or []:
- link = xml_elem('link', entry, href=link['href'])
+ linkelm = xml_elem('link', entry, href=link['href'])
if link.get('rel'):
- link.attrib['rel'] = link['rel']
+ linkelm.attrib['rel'] = link['rel']
if link.get('type'):
- link.attrib['type'] = link['type']
+ linkelm.attrib['type'] = link['type']
if link.get('hreflang'):
- link.attrib['hreflang'] = link['hreflang']
+ linkelm.attrib['hreflang'] = link['hreflang']
if link.get('title'):
- link.attrib['title'] = link['title']
+ linkelm.attrib['title'] = link['title']
if link.get('length'):
- link.attrib['length'] = link['length']
+ linkelm.attrib['length'] = link['length']
_add_text_elm(entry, self.__atom_summary, 'summary')

1
debian/patches/series vendored Normal file
View file

@ -0,0 +1 @@
debian/0001-fix-atom-feed-links.patch