jayvdb created this task. jayvdb added a subscriber: jayvdb. jayvdb added a project: pywikibot-core.
TASK DESCRIPTION core Page.interwiki() returns Links whereas compat Page.interwiki() returns Pages
The core implementation of Page.interwiki was created in 2008, with an incompatible return type to compat.
As an example of the problems this cases, the imagetransfer script -interwiki argument was ported incorrectly and nobody has noticed in over one year.
``` Traceback (most recent call last): File "pwb.py", line 222, in <module> run_python_file(filename, argv, argvu, file_package) File "pwb.py", line 81, in run_python_file main_mod.__dict__) File "./scripts/imagetransfer.py", line 353, in <module> main() File "./scripts/imagetransfer.py", line 350, in main bot.run() File "./scripts/imagetransfer.py", line 269, in run imagelist.append(linkedPage.imagelinks(followRedirects=True)) AttributeError: 'Link' object has no attribute 'imagelinks' Found 1 wikipedia:mk processes running, including this one. Dropped throttle(s). <type 'exceptions.AttributeError'> ```
Note also even the basic attributes of a Link are different from Page. e.g. Link.title and Link.namespace are a property and title() and namespace() are an error, whereas Page.title and Page.namespace are a method and must be called as title() and namespace().
TASK DETAIL https://phabricator.wikimedia.org/T86623
REPLY HANDLER ACTIONS Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign <username>.
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: jayvdb Cc: Aklapper, jayvdb, pywikipedia-bugs
pywikipedia-bugs@lists.wikimedia.org