_XmlSitemapParser.flush calls self._parser.flush() unguarded.
ExpatParser.flush isn't part of the documented IncrementalParser interface and doesn't exist before 3.10.14 - verified False on 3.10.0 / 3.10.8 / 3.10.12 / 3.10.13, True on 3.10.14+, all of which satisfy our requires-python = ">=3.10"
- consequence on those interpreters: every sitemap parse logs
Failed to parse remaining XML data: 'ExpatParser' object has no attribute 'flush' at WARNING
- not data loss -
flush() contributes 0 items in every scenario I tried (single chunk, 3 chunks, truncated document, 20k <url> entries fed in 1 KiB slices cutting tokens mid-token). Expat's reparse deferral landed in the same release as flush(), so on interpreters without flush() nothing is ever left buffered
- so: pure log noise, low priority. Guard with
suppress(AttributeError) / getattr, or drop the call
- separately, the
except swallows the yield loop below it - if flush() ever did raise with items buffered, they'd be discarded. Cheap to make robust by yielding self._handler.items in a finally
_XmlSitemapParser.flushcallsself._parser.flush()unguarded.ExpatParser.flushisn't part of the documentedIncrementalParserinterface and doesn't exist before 3.10.14 - verifiedFalseon 3.10.0 / 3.10.8 / 3.10.12 / 3.10.13,Trueon 3.10.14+, all of which satisfy ourrequires-python = ">=3.10"Failed to parse remaining XML data: 'ExpatParser' object has no attribute 'flush'at WARNINGflush()contributes 0 items in every scenario I tried (single chunk, 3 chunks, truncated document, 20k<url>entries fed in 1 KiB slices cutting tokens mid-token). Expat's reparse deferral landed in the same release asflush(), so on interpreters withoutflush()nothing is ever left bufferedsuppress(AttributeError)/getattr, or drop the callexceptswallows theyieldloop below it - ifflush()ever did raise with items buffered, they'd be discarded. Cheap to make robust by yieldingself._handler.itemsin afinally