Last modified: 2014-11-04 23:29:12 UTC
When the username starts in lowercase it's stored with that lowercase in the “_sites” map. A site requested via data_repository() is stored with an uppercase starting username. >>> import pywikibot >>> s = pywikibot.Site('test', 'wikidata') >>> pywikibot._sites {'wikidata:test:xZise': Site("test", "wikidata")} >>> type(s) <class 'pywikibot.site.APISite'> >>> d = s.data_repository() >>> type(d) <class 'pywikibot.site.DataSite'> >>> pywikibot._sites {'wikidata:test:xZise': Site("test", "wikidata"), 'wikidata:test:XZise': DataSite("test", "wikidata")} This doesn't make a difference usually, because it requests via the “original” lowercased name: >>> import pywikibot >>> pywikibot.Site('en', 'wikipedia') Site("en", "wikipedia") >>> pywikibot._sites {'wikipedia:en:xZise': Site("en", "wikipedia")} >>> pywikibot.Site('en', 'wikipedia') Site("en", "wikipedia") >>> pywikibot._sites {'wikipedia:en:xZise': Site("en", "wikipedia")}