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'),)
Am I just not understanding the doc correctly?
You are right Either the documentation or the implementation is wrong. I will try to find out what was really meant; maybe the compat release can give a hint.
Thanks for investigating.
xqt
Am 31.03.2024 um 17:34 schrieb Roy Smith roy@panix.com:
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'),)
Am I just not understanding the doc correctly? _______________________________________________ pywikibot mailing list -- pywikibot@lists.wikimedia.org Public archives at https://lists.wikimedia.org/hyperkitty/list/pywikibot@lists.wikimedia.org/me... To unsubscribe send an email to pywikibot-leave@lists.wikimedia.org
https://phabricator.wikimedia.org/T361531
On Apr 1, 2024, at 2:45 PM, roy@panix.com wrote:
Ok, thanks for the confirmation. I'll open a bug later today.
On Apr 1, 2024 14:42, info@gno.de wrote: You are right Either the documentation or the implementation is wrong. I will try to find out what was really meant; maybe the compat release can give a hint.
Thanks for investigating.
xqt
Am 31.03.2024 um 17:34 schrieb Roy Smith roy@panix.com:
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'),)
Am I just not understanding the doc correctly? _______________________________________________ pywikibot mailing list -- pywikibot@lists.wikimedia.org Public archives at https://lists.wikimedia.org/hyperkitty/list/pywikibot@lists.wikimedia.org/me... To unsubscribe send an email to pywikibot-leave@lists.wikimedia.org
pywikibot mailing list -- pywikibot@lists.wikimedia.org Public archives at https://lists.wikimedia.org/hyperkitty/list/pywikibot@lists.wikimedia.org/me... To unsubscribe send an email to pywikibot-leave@lists.wikimedia.org
pywikibot mailing list -- pywikibot@lists.wikimedia.org Public archives at https://lists.wikimedia.org/hyperkitty/list/pywikibot@lists.wikimedia.org/me... To unsubscribe send an email to pywikibot-leave@lists.wikimedia.org