diff options
-rw-r--r-- | debian/patches/debian/0001-fix-atom-feed-links.patch | 38 | ||||
-rw-r--r-- | debian/patches/series | 1 |
2 files changed, 39 insertions, 0 deletions
diff --git a/debian/patches/debian/0001-fix-atom-feed-links.patch b/debian/patches/debian/0001-fix-atom-feed-links.patch new file mode 100644 index 0000000..cac3d47 --- /dev/null +++ b/debian/patches/debian/0001-fix-atom-feed-links.patch @@ -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') + diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..09abc62 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +debian/0001-fix-atom-feed-links.patch |