You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The latest published version (0.9) contains an unwanted? API change. The getter function summary() in FeedEntry is now returning a dict instead of a string.
See the following example reading the Summary of an entry:
Expected behavior: Return Summary as String
Actual behavior: Summary is returned as dict -> {'summary': "content"}
Steps to reproduce:
Create test.py in current folder:
from feedgen.feed import FeedGenerator
from feedgen.version import version as feedgenversion
print('Feedgen Version: {}'.format(feedgenversion))
feed = FeedGenerator()
fe = feed.add_entry()
fe.summary('description')
print('Return type: {}'.format(type(feed.entry()[0].summary())))
print("Summary: {}".format(feed.entry()[0].summary()))
as there is a documented CVE in feedgen version 0.8 [0] i wonder when there will be a reaction to this. Would it help to propose a fix and submit it as a merge request?
You are absolutely right that this is not great. Unfortunately, that's a design decision from right at the beginning of the project which isn't easy to fix. The methods always return the internal storage structure. This may be a string (if only a string is being stored), but will often be a dictionary.
Summary allows you to store a type as well as the summary itself. Returning only the summary would mean that there is no way to see what type is stored for the summary, which then would be inconsistent with the other methods.
That being said, I'll try to add changes like these to release notes.
The latest published version (0.9) contains an unwanted? API change. The getter function summary() in FeedEntry is now returning a dict instead of a string.
python-feedgen/feedgen/entry.py
Line 462 in ffe3e4d
See the following example reading the Summary of an entry:
Expected behavior: Return Summary as String
Actual behavior: Summary is returned as dict -> {'summary': "content"}
Steps to reproduce:
The text was updated successfully, but these errors were encountered: