Page MenuHomePhabricator

imagecopy fails for a given sample
Open, HighPublic

Description

There is a sample for this script given in the doc but it fails:

C:\pwb\GIT\core>pwb.py imagecopy -newimages:100
Retrieving 49 pages from wikipedia:de.
WARNING: .\scripts\imagecopy.py:536: DeprecationWarning: pywikibot.page.FilePage
.getLatestUploader is deprecated for 3 years and 11 months; use FilePage.latest_
file_info.user instead.
  username = imagepage.getLatestUploader()[0]

Traceback (most recent call last):
  File "C:\pwb\GIT\core\pwb.py", line 257, in <module>
    if not main():
  File "C:\pwb\GIT\core\pwb.py", line 250, in main
    run_python_file(filename, [filename] + args, argvu, file_package)
  File "C:\pwb\GIT\core\pwb.py", line 119, in run_python_file
    main_mod.__dict__)
  File ".\scripts\imagecopy.py", line 594, in <module>
    main()
  File ".\scripts\imagecopy.py", line 555, in main
    imagepage.templates()).getnewname()
  File ".\scripts\imagecopy.py", line 403, in __init__
    super(TkdialogIC, self).__init__()
TypeError: __init__() missing 3 required positional arguments: 'photo_descriptio
n', 'photo', and 'filename'
<class 'TypeError'>
CRITICAL: Closing network session.

C:\pwb\GIT\core>

Event Timeline

Xqt created this task.Oct 30 2018, 7:18 AM
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptOct 30 2018, 7:18 AM

Change 470550 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [deprecated] Use latest_file_info.user instead of getLatestUploader()[0]

https://gerrit.wikimedia.org/r/470550

Xqt triaged this task as High priority.Oct 30 2018, 7:33 AM
Xqt added a comment.Oct 30 2018, 7:48 AM

Hm, this script never worked. Do we need it ;)

Hm, this script never worked. Do we need it ;)

It worked, but someone broke it.
Tons of things have changed in the library part, but I don't think impact on the scripts that are using it is noticed enough.

Change 470550 merged by jenkins-bot:
[pywikibot/core@master] [deprecated] Use latest_file_info.user instead of getLatestUploader()[0]

https://gerrit.wikimedia.org/r/470550

Framawiki added a subscriber: Framawiki.
Xqt added a comment.Dec 23 2018, 7:16 PM

Tkdialog was moved from flickrripper.py to gui.py in a21b31b and reused in f261cada for imagecopy.py when porting from compat but Tkdialog was never designed for imagecopy.py and I assume it never worked in core therefore.

Xqt claimed this task.Dec 23 2018, 8:36 PM

Change 481275 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [bugfix] Fix Tkdialog

https://gerrit.wikimedia.org/r/481275

Xqt moved this task from Backlog to Needs Review on the Pywikibot board.Feb 3 2019, 11:22 AM