https://bugzilla.wikimedia.org/show_bug.cgi?id=71398
Bug ID: 71398 Summary: Username case changes after site.data_repository Product: Pywikibot Version: core (2.0) Hardware: All OS: All Status: NEW Severity: trivial Priority: Unprioritized Component: General Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: CommodoreFabianus@gmx.de Web browser: --- Mobile Platform: ---
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")}
https://bugzilla.wikimedia.org/show_bug.cgi?id=71398
John Mark Vandenberg jayvdb@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Depends on| |71451
https://bugzilla.wikimedia.org/show_bug.cgi?id=71398 Bug 71398 depends on bug 71451, which changed state.
Bug 71451 Summary: Site cache does not distinguish between classes https://bugzilla.wikimedia.org/show_bug.cgi?id=71451
What |Removed |Added ---------------------------------------------------------------------------- Status|PATCH_TO_REVIEW |RESOLVED Resolution|--- |FIXED
https://bugzilla.wikimedia.org/show_bug.cgi?id=71398
John Mark Vandenberg jayvdb@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jayvdb@gmail.com Blocks| |70936
pywikipedia-bugs@lists.wikimedia.org