Page MenuHomePhabricator

imagecopy fails for a given sample
Closed, DeclinedPublic

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

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

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

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.

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

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

This script is no longer maintained. Please reopen if you still use this script.

Change 481275 abandoned by Xqt:
[pywikibot/core@master] [bugfix] Fix Tkdialog

Reason:
no longer maintained

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