XZise added a comment.
Okay after a bit of trickery I was able to determine that the UTF8 content was
encoded as cp852 instead:
>>> 'ňłćÚí×:L┼źi-pia╠Źt:A-la-pek-g├║'.encode('cp852').decode('utf8')
'分類:Lūi-pia̍t:A-la-pek-gú'
And as I thought the API returned a result for the other namespace name:
https://zh-min-nan.wiktionary.org/w/api.php?action=query&prop=revisions&titles=%E5%88%86%E9%A1%9E:L%C5%ABi-pia%CC%8Dt:A-la-pek-g%C3%BA
(apart from the fact that it says missing)
I don't get your error when I try to get a revisions (and the error I get is
correct). When I remove one namespace but still use the namespace alias it does
work.
>>> import pywikibot
>>> p = 'ňłćÚí×:L┼źi-pia╠Źt:A-la-pek-g├║'.encode('cp852').decode('utf8')
>>> po = pywikibot.Page(pywikibot.Site('zh-min-nan', 'wiktionary'), p)
>>> po.exists()
False
>>> list(po.revisions(total=1))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/xzise/Programms/core/pywikibot/page.py", line 1374, in revisions
step=step, total=total)
File "/home/xzise/Programms/core/pywikibot/site.py", line 3169, in
loadrevisions
raise NoPage(page)
pywikibot.exceptions.NoPage: Page
[[wiktionary:zh-min-nan:Lūi-pia̍t:Lūi-pia̍t:A-la-pek-gú]] doesn't exist.
>>> po = pywikibot.Page(pywikibot.Site('zh-min-nan', 'wiktionary'),
'分類:A-la-pek-gú')
>>> po.exists()
True
>>> list(po.revisions(total=1))
[<pywikibot.page.Revision object at 0x7f1d1ebc2fd0>]
TASK DETAIL
https://phabricator.wikimedia.org/T86696
REPLY HANDLER ACTIONS
Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign
<username>.
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: XZise
Cc: Aklapper, JAnD, XZise, jayvdb, pywikipedia-bugs
_______________________________________________
Pywikipedia-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-bugs