binbot created this task.
binbot added a project: Pywikibot.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.
TASK DESCRIPTION
**Steps to replicate the issue**:
>>> site = pywikibot.Site('hu', 'wikipedia')
>>> page=pywikibot.Page(site, 'Vita:WP:AZ')
>>> page.text
pywikibot.exceptions.InvalidTitleError: The (non-)talk page of 'Vita:WP:AZ'
is a valid title in another namespace.
**What happens?**: `WP:` used to be a standard redirect to project pages,
technically in main namespace. Now it is an alias for `Project: `namespace.
I watched hu:WP:AZ when it was in article namespace, and its talk page was
'Vita:WP:AZ'. Now this is ambigous. The error is in MediaWiki config, however,
Pywikibot should catch it.
**What should have happened instead?**:
I don't know. As far as I understand, `Page.text `is designed to return a
string under any circumstances and never raise an error. But to return an empty
string for an invalid title would be strange, and anyway, itt will fail on
saving, so work with text is senseless.
**Software version** (skip for WMF-hosted wikis like Wikipedia): 8.0.0
**Other information** (browser name/version, screenshots, etc.):
In the source code of Page.text there is a comment: "# TODO: what other
exceptions might be returned?" Now the answer is here. :-)
TASK DETAIL
https://phabricator.wikimedia.org/T330786
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: binbot
Cc: Xqt, Aklapper, pywikibot-bugs-list, binbot, PotsdamLamb, Jyoo1011,
JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS,
Framawiki, Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx,
jayvdb, Masti, Alchimista
_______________________________________________
pywikibot-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]