Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow integer to be used for enclosure length #129

Merged
merged 1 commit into from
Dec 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
  • Loading branch information
lkiesow committed Dec 22, 2023
commit 51d743f5d9d3a21356ad4e7fe58075f86d934c28
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