Closed mirekdlugosz closed 3 years ago
Merged. Thank you!
The CI failure is likely due to a new Mypy version (so, not due to this).
I don't think it's worthwhile for us to work around this behavior [...]
Agree, I definitely don't want to change feedparser's behavior.
Fix for #240. Enclosures without href in RSS feeds are skipped, so feed can be handled by reader. See below for reproducer and test results.
I have not added enclosure with empty href to atom feed, because things are more involved there. Following XML:
produces valid (if pointless) Enclosure:
I only skimmed through ATOM specification, and I think ATOM requires links to contain at least scheme. Meanwhile, feedparser considers them to be relative and resolves to base. I don't think it's worthwhile for us to work around this behavior, and I definitely wouldn't make feedparser's behavior change a requirement for this PR. But I'm willing to work on whatever you think is best here.
Reproducer: