Skip to content

knowledge_pad: ignore feedparser.NonXMLContentType

Jérome Perrin requested to merge fix/le_monde_rss into master

When server replies with a non XML content type feeparser attempt to parse anyway, but set the bozo flag.

https://universal-feedparser.readthedocs.io/en/latest/#handling-incorrectly-declared-media-types

If parsing fail because the feed is not a valid RSS XML stream, feedparser fail in other ways, so we can safely ignore this error.

This should repair recent failures with testFeedReaderGadget now that le monde changed configuration on their website:

 $ curl -sD -  -o /dev/null https://www.lemonde.fr/rss/une.xml | grep Content-Type
 Content-Type: text/html;charset=UTF-8

Merge request reports