Tacsipacsi created this task.
Tacsipacsi added a project: Pywikibot.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.
TASK DESCRIPTION
Steps to reproduce
------------------
1. Create `scripts/userscripts/watchlists_core.py` with the following content:
import pywikibot
commons = pywikibot.Site(url='https://commons.wikimedia.org')
print('Commons base_url: %s' % commons.base_url('/w/api.php'))
meta = pywikibot.Site(url='https://meta.wikimedia.org')
print('Meta base_url: %s' % meta.base_url('/w/api.php'))
2. Run the script (e.g. `./pwb.py base_url_repro`).
Actual result
-------------
Commons base_url: https://commons.wikimedia.org/w/api.php
Meta base_url: https://commons.wikimedia.org/w/api.php
Expected result
---------------
Commons base_url: https://commons.wikimedia.org/w/api.php
Meta base_url: https://meta.wikimedia.org/w/api.php
Software version
----------------
Latest `master` of Pywikibot (aa816795099f6eb6d7b381b0b8081c87c20507b9
<https://phabricator.wikimedia.org/rPWBCaa816795099f6eb6d7b381b0b8081c87c20507b9>).
Other information
-----------------
Notice the Meta `base_url`: in the //actual// result, it points to Commons.
If I swap the two pairs of lines, both start to point to Meta. Clearly some
caching is in the play, which may be triggered by the instantiation from URLs
rather than from family/code pairs (in the real script I’m working on, I have
access only to URLs and database names like `commonswiki`, so using family/code
pairs is not an option).
TASK DETAIL
https://phabricator.wikimedia.org/T386665
EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: Tacsipacsi
Cc: Aklapper, Tacsipacsi, pywikibot-bugs-list, mevo, PotsdamLamb, Jyoo1011,
JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Aram, Viztor, Wenyi, Tbscho,
MayS, Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, Hannolans, mys_721tx,
Xqt, jayvdb, Masti, Alchimista
_______________________________________________
pywikibot-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]