Skip to content

Commit

Permalink
Allow integer to be used for enclosure length
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lkiesow committed Dec 22, 2023
1 parent ee433b8 commit 51d743f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion feedgen/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 51d743f

Please sign in to comment.