Last modified: 2014-07-30 00:03:05 UTC
ns parameter of Page object and/or defaultnamespace of Link object should force the Namespace instead of add a Namespace if no one is given. Especially for categories but also for other namespaces it is possible to name pages which looks like a Namespace e.g. "Kategory:Wikipedia:Hilfe". site = pywikibot.Site() pywikibot.Category(pywikibot.Link("Wikipedia:Hilfe"), defaultNamespace=14) or pywikibot.Category(site, "Wikipedia:Hilfe", ns=14) fails with an exception error pywikibot.Page(site, "Wikipedia:Hilfe", ns=14) gives Page("Wikipedia:Hilfe") instead of the category page as expected. There are several scripts which fix that point by adding a "category:" in front of a page title which should be obsolete. See https://gerrit.wikimedia.org/r/#/c/132781/ for example
https://gerrit.wikimedia.org/r/#/c/148337/