AntiCompositeNumber added a comment.
Silently ignoring the namespace parameter causes problems. I'm writing a
script that pulls results from a database query, passing page_namespace and
page_title to the page constructor. This bug caused an issue when it came to a
page that had a namespace prefix at the beginning of the title:
Python 3.7.7 (default, Mar 22 2020, 15:52:55)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pywikibot
>>> site = pywikibot.Site('en', 'wikipedia')
>>> expected = pywikibot.Page(site, 'Wikipedia:WP:Athlete is not
exclusionary')
>>> print(expected)
[[wikipedia:en:Wikipedia:WP:Athlete is not exclusionary]]
>>> actual = pywikibot.Page(site, 'WP:Athlete is not exclusionary', ns=4)
>>> print(actual)
[[wikipedia:en:Wikipedia:Athlete is not exclusionary]]
>>> actual == expected
False
I would agree with @Dalba's solution, but using a force parameter is probably
easier to implement without having to announce and deprecate. Wiki editors can
be quite creative with their page names, and for all we know someone depends on
this spacebar heating <https://xkcd.com/1172/>.
TASK DETAIL
https://phabricator.wikimedia.org/T67262
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: AntiCompositeNumber
Cc: AntiCompositeNumber, Dvorapa, gerritbot, zhuyifei1999, matej_suchanek,
Framawiki, Dalba, Aklapper, StudiesWorld, Xqt, jayvdb, pywikibot-bugs-list,
Blissjay007, Oblanco79, Alter-paule, Beast1978, Un1tY, Chaytanya, Zkhalido,
Hook696, Daryl-TTMG, RomaAmorRoma, E.S.A-Sheild, Kent7301, Meekrab2012,
joker88john, Viztor, DannyS712, CucyNoiD, NebulousIris, Wenyi, Kieubinhtb,
Tks4Fish, Gaboe420, Mh-3110, Versusxo, Majesticalreaper22, Giuliamocci,
Adrian1985, Asad_Ali_Palijo, Cpaulf30, Lahi, Af420, Darkminds3113, Bsandipan,
Lordiis, Adik2382, Soteriaspace, Th3d3v1ls, JakeTheDeveloper, Ramalepe,
Liugev6, Tbscho, MayS, WSH1906, Lewizho99, Mdupont, JJMC89, Maathavan,
D3r1ck01, Altostratus, Avicennasis, MuhammadShuaib, Tmalhotra, SimmeD,
mys_721tx, Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs