The docs for BasePage.get() say:
pywikibot.exceptions.IsRedirectPageError – The page is a redirect. The argument of the exception is the title of the page it redirects to.
but that doesn't seem to be what's actually happening:
from pywikibot import Site, Page from pywikibot.exceptions import IsRedirectPageError site = Site("en") page = Page(site, "Template:shortdescription") try: print(page.get()) except IsRedirectPageError as ex: print(f"{ex.args=}")
prints
ex.args=(Page('Template:Shortdescription'),)
It's not clear if the docs are wrong or the code is wrong