Repository navigation
Conversation
Author
|
Fixed the pre-commit.ci failure: the XML literals in tests/test_sitemap.py used 2 and 6 space indents, which editorconfig-checker flagged. Re-indented them to multiples of 4, the suite passes locally (4309 passed, 8 skipped), and pre-commit.ci is green on the new head. |
Author
|
Hi @kurtmckee, could you take a look at this when you have a moment? Happy to fix up anything that needs changing. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #535.
Feedparser previously parsed sitemap documents to an empty result (no version, no entries). This adds sitemap support following the existing namespace-handler architecture:
feedparser/namespaces/sitemap.py: a<urlset>maps to the feed and each<url>to an entry —<loc>becomes the entrylink/links,<lastmod>becomesupdated/updated_parsed, and<changefreq>/<priority>are stored verbatim on the entry. Sitemap index documents (<sitemapindex>/<sitemap>) are handled the same way. The parsed version is reported assitemap.news:news) is exposed as a nestednewsdict on each entry (publication.name/publication.language,publication_date(+_parsed),title,keywords,genres,stock_tickers), and its title, publication date, and keywords are additionally mapped onto the standard entrytitle,published/published_parsed, andtagskeys so news sitemaps work with feed-oriented consumers such as feed2fedi (the reporter's use case).feedparser/mixin.pyregisters the namespace module and the sitemap/news namespace URIs;feedparser/namespaces/_base.pyroutes<url>to the sitemap entry handler only while inside a sitemap (RSS<image><url>behavior is unchanged and covered by a regression test);feedparser/api.pyadds thesitemapversion string.Tests: new
tests/test_sitemap.py(8 tests: plain urlset fields, news publication/mapping, optional news elements, no cross-entry leakage, sitemap index, RSS<url>regression) plus twotests/wellformed/sitemap/fixtures. Full suite: 4309 passed, 8 skipped. Baseline (implementation stashed, new fixtures present) fails exactly the 4 new wellformed fixture cases and passes everything else (4297 passed, 8 skipped), so there are no regressions. The stale volunteer from January 2026 never produced a PR, so I went ahead; happy to adjust naming/shape to maintainer preference.