feedparser
feedparser copied to clipboard
'updated' kludge status
I just spent a while trying to figure out why this code didn't work as expected:
field = 'updated'
# `data` is a FeedParserDict retrieved from `parsed_feed.feed`...
if field in data and data[field]:
# do a thing with 'updated'
I found this in the source code: https://github.com/kurtmckee/feedparser/blob/e6a1fb846af30abe67105fe446b3035a8ce8d9bc/feedparser/util.py#L73-L90
- Those issues listed in the comment don't seem to have anything to do with this behavior? Maybe from a previous issue tracker?
- How long is this going to be here temporarily? 😀 A brief git blame shows its been in the code for at least 8 years when it was last moved to the
utils.pyfile. I didn't dig any further to see when it was added prior to that. - Since this code was getting run in a pytest test, and the failure included a couple hundred lines of debug information, I missed the warning that the code raises.