https://bugzilla.wikimedia.org/show_bug.cgi?id=70766
Bug ID: 70766 Summary: It is using the user configured site, even though another site was requested Product: Pywikibot Version: core (2.0) Hardware: All OS: All Status: NEW Severity: normal Priority: Unprioritized Component: General Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: CommodoreFabianus@gmx.de Web browser: --- Mobile Platform: ---
In the user-config a specific site is set but via 'pywikibot.getSite' or 'pywikibot.Site' another (unrelated) Site (family) is chosen.
But in fact after a few requests to the unrelated site it's also querying the user configured site. I found this when I was trying to figure out why I got warnings for a complete legit API call.
import pywikibot wp = pywikibot.getSite("en", "wikipedia") wp.tokens['edit']
https://en.wikipedia.org/w/api.php https://en.wikipedia.org/w/api.php https://en.wikipedia.org/w/api.php https://en.wikipedia.org/w/api.php https://en.wikipedia.org/w/api.php http://wiki.kerbalspaceprogram.com/w/api.php WARNING: API warning (query): Unrecognized value for parameter 'meta': tokens WARNING: API warning (main): Unrecognized parameter: 'type' Traceback (most recent call last): File "<stdin>", line 1, in <module> File "pywikibot/site.py", line 1200, in __getitem__ return storage[key] KeyError: 'csrf'
If I change the user configuration to the English Wikipedia all api.php calls vanish except one to en.wikipedia.org and I get a legit result.
Each URI is directly printed in the first line threadedhttp's Http.request method.