On the page/__init__ file, in the class WikibaseEntity, there is function called getattr(), and it's returns at the end (line 3239): super().getattr(). The problem is that WikibaseEntity have no super class... I didn't understand what it's supposed to do so I can't fix it.
Description
Details
| Subject | Repo | Branch | Lines +/- | |
|---|---|---|---|---|
| [bugfix] Fix __getattr__ for WikibaseEntity | pywikibot/core | master | +2 -1 |
Event Timeline
WikibaseEntity is implicit derived from object and each object has this method. Therefore this call is valid.
Ok, it's only if I try to get invalid value:
import pywikibot
site = pywikibot.Site('he', 'wikisource')
page = pywikibot.Page(site, 'קטגוריה:רבי אבא')
item = pywikibot.ItemPage.fromPage(page)
item.abcTraceback (most recent call last): File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in <module> start(fakepyfile,mainpyfile) File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start exec(open(mainpyfile).read(), __main__.__dict__) File "<string>", line 5, in <module> File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.8/site-packages/pywikibot/page/__init__.py", line 3755, in __getattr__ return super().__getattr__(name) AttributeError: 'super' object has no attribute '__getattr__' CRITICAL: Exiting due to uncaught exception <class 'AttributeError'>
[Program finished]
Cannot reproduce it:
C:\pwb\GIT\core>pwb shell
Welcome to the Pywikibot interactive shell!
>>> s = pywikibot.Site('wikisource:he')
>>> p = pywikibot.Page(s, 'קטגוריה:רבי אבא')
>>> i = pywikibot.ItemPage.fromPage(p)
>>> i
ItemPage('Q7221758')
>>>What is your result of pwb version?
You are supposed to call item.abc, then it seems to fail. This should fail either, but the error message should rather be "there is nothing like abc" than "there is no getattr on super". Might be my mistake.
I think you tried to do something but it's not working. so if name not in self.DATA_ATTRIBUTES we need to raise an exception or warning, and delete the last line of the func...
Change 683820 had a related patch set uploaded (by Matěj Suchánek; author: Matěj Suchánek):
[pywikibot/core@master] [bugfix] Fix __getattr__ for WikibasePage and WikibaseEntity
Change 683820 merged by jenkins-bot:
[pywikibot/core@master] [bugfix] Fix __getattr__ for WikibaseEntity