RPI2026F1 created this task. RPI2026F1 added a project: Pywikibot. Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.
TASK DESCRIPTION **Steps to replicate the issue** (include links if applicable): - Install pywikibot through pip through a virtualenv. Importantly, **do not install a wikitext parser like mwparserfromhell** - Run this script: try: import pywikibot except Exception: import os os.system('pip install mwparserfromhell') import pywikibot site = pywikibot.Site('wikidata', 'wikidata') **What happens?**: Traceback (most recent call last): File "/private/tmp/tmp.py", line 7, in <module> site = pywikibot.Site('wikidata', 'wikidata') File "/Users/User/.local/share/virtualenvs/tmp-agwWamBd/lib/python3.10/site-packages/pywikibot/__init__.py", line 1118, in Site _sites[key] = interface(code=code, fam=fam, user=user) File "/Users/User/.local/share/virtualenvs/tmp-agwWamBd/lib/python3.10/site-packages/pywikibot/site/_datasite.py", line 38, in __init__ super().__init__(*args, **kwargs) File "/Users/User/.local/share/virtualenvs/tmp-agwWamBd/lib/python3.10/site-packages/pywikibot/site/_apisite.py", line 117, in __init__ super().__init__(code, fam, user) File "/Users/User/.local/share/virtualenvs/tmp-agwWamBd/lib/python3.10/site-packages/pywikibot/site/_basesite.py", line 54, in __init__ if not all(x in pywikibot.family.CODE_CHARACTERS for x in code): File "/Users/User/.local/share/virtualenvs/tmp-agwWamBd/lib/python3.10/site-packages/pywikibot/site/_basesite.py", line 54, in <genexpr> if not all(x in pywikibot.family.CODE_CHARACTERS for x in code): AttributeError: module 'pywikibot' has no attribute 'family'. Did you mean: 'Family'? CRITICAL: Exiting due to uncaught exception <class 'AttributeError'> **What should have happened instead?**: It shouldn't fail. In fact, running that script again will make it work. **Software version** (skip for WMF-hosted wikis like Wikipedia): **Other information** (browser name/version, screenshots, etc.): TASK DETAIL https://phabricator.wikimedia.org/T326452 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: RPI2026F1 Cc: Aklapper, RPI2026F1, pywikibot-bugs-list, PotsdamLamb, Jyoo1011, JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, Framawiki, Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, Xqt, jayvdb, Masti, Alchimista
_______________________________________________ pywikibot-bugs mailing list -- pywikibot-bugs@lists.wikimedia.org To unsubscribe send an email to pywikibot-bugs-le...@lists.wikimedia.org