Running pywikibot.Site().allpages(namespace=6) return with only a subset of the results.
When running PageGenerator.result in _generators.py, it fails when trying to upcast from Page to FilePage partway through the list.
The reason seems to be that one of the files it encounters, File:Foo.txt is an extension that is no longer allowed. Although it suppresses the ValueError when doing the extension check in the __init__ function, in the update_page(p, pagedata, self.props) just below, it errors when checking if the file is a FilePage.
pywikibot 9.4.0