From 51d743f5d9d3a21356ad4e7fe58075f86d934c28 Mon Sep 17 00:00:00 2001 From: Lars Kiesow Date: Fri, 22 Dec 2023 11:22:23 +0100 Subject: [PATCH] Allow integer to be used for enclosure length This patch allows integer to be used for specifying the enclosure length instead of just allowing string values. This is certainly the more natural choice for something representing a number. With this patch string values will continue to work. This fixes #104 --- feedgen/entry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feedgen/entry.py b/feedgen/entry.py index 71d295a..f7a13a8 100644 --- a/feedgen/entry.py +++ b/feedgen/entry.py @@ -668,7 +668,7 @@ def enclosure(self, url=None, length=None, type=None): :returns: Data of the enclosure element. ''' if url is not None: - self.link(href=url, rel='enclosure', type=type, length=length) + self.link(href=url, rel='enclosure', type=type, length=str(length)) return self.__rss_enclosure def ttl(self, ttl=None):