https://bugzilla.wikimedia.org/show_bug.cgi?id=55014
Web browser: --- Bug ID: 55014 Summary: Let bots use canonical namespaces Product: Pywikibot Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: Unprioritized Component: General Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: legoktm.wikipedia@gmail.com Classification: Unclassified Mobile Platform: ---
Originally from: http://sourceforge.net/p/pywikipediabot/feature-requests/332/ Reported by: pathoschild Created on: 2013-02-23 02:45:38 Subject: Let bots use canonical namespaces Original description: Let bots use canonical namespaces instead of translations from the family files. This is useful for crosswiki bots, where invalid namespace names may not be detected by the operator (most recently [1][2]).
The attached patch implements this by adding an optional constructor argument to Page. For example, the current behaviour is unchanged: ns = wikipedia.Page(site, title).namespaceName() # Utilisateur:Pathoschild But a constructor argument enables canonical namespaces: ns = wikipedia.Page(site, title, translateNamespace=False).namespaceName() # User:Pathoschild
[1] http://meta.wikimedia.org/wiki/User%5C_talk:Pathoschild?oldid=5269904%5C#Pro... [2] http://meta.wikimedia.org/wiki/User%5C_talk:Pathoschild?oldid=5269904%5C#Pol...
https://bugzilla.wikimedia.org/show_bug.cgi?id=55014
--- Comment #1 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- Patch which enables canonical namespace support.
https://bugzilla.wikimedia.org/show_bug.cgi?id=55014
--- Comment #2 from Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com --- - **labels**: 3222924 -->
https://bugzilla.wikimedia.org/show_bug.cgi?id=55014
Kunal Mehta (Legoktm) legoktm.wikipedia@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://sourceforge.net/p/p | |ywikipediabot/feature-reque | |sts/332
https://bugzilla.wikimedia.org/show_bug.cgi?id=55014
John Mark Vandenberg jayvdb@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jayvdb@gmail.com Version|unspecified |compat (1.0)
--- Comment #3 from John Mark Vandenberg jayvdb@gmail.com --- The patch is against compat, but core has the same problem.
Core now has a Namespace class, which captures the canonical namespaces data of the wiki. Relevant code at: https://git.wikimedia.org/blob/pywikibot%2Fcore.git/9b67ec1424d160d1968ef3f3... https://git.wikimedia.org/blob/pywikibot%2Fcore.git/9b67ec1424d160d1968ef3f3...
The Namespace class isnt utilised in the old link parsing algorithms. There are a few core changesets related to this problem: https://gerrit.wikimedia.org/r/#/c/150872/ - Link normalization https://gerrit.wikimedia.org/r/#/c/148337/ - force using namespace param; ignore namespace in title
pywikipedia-bugs@lists.wikimedia.org