eflyjason created this task.
eflyjason added a project: Pywikibot-Other-scripts.
Herald added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION

When I run python pwb.py imagecopy.py -newimages:10:

In Python 2:

~/Documents/Mediawiki/Pywikibot/core$ python pwb.py imagecopy.py -newimages:10
Retrieving 6 pages from wikipedia:test.
Traceback (most recent call last):
  File "pwb.py", line 263, in <module>
    if not main():
  File "pwb.py", line 256, in main
    run_python_file(filename, [filename] + args, argvu, file_package)
  File "pwb.py", line 121, in run_python_file
    main_mod.__dict__)
  File "./scripts/imagecopy.py", line 573, in <module>
    main()
  File "./scripts/imagecopy.py", line 534, in main
    imagepage.templates()).getnewname()
  File "./scripts/imagecopy.py", line 385, in __init__
    super(TkdialogIC, self).__init__()
TypeError: __init__() takes exactly 4 arguments (1 given)
<type 'exceptions.TypeError'>
CRITICAL: Closing network session.

In Python 3:

~/Documents/Mediawiki/Pywikibot/core$ python3 pwb.py imagecopy.py -newimages:10
Retrieving 6 pages from wikipedia:test.
Traceback (most recent call last):
  File "pwb.py", line 263, in <module>
    if not main():
  File "pwb.py", line 256, in main
    run_python_file(filename, [filename] + args, argvu, file_package)
  File "pwb.py", line 121, in run_python_file
    main_mod.__dict__)
  File "./scripts/imagecopy.py", line 573, in <module>
    main()
  File "./scripts/imagecopy.py", line 534, in main
    imagepage.templates()).getnewname()
  File "./scripts/imagecopy.py", line 385, in __init__
    super(TkdialogIC, self).__init__()
TypeError: __init__() missing 3 required positional arguments: 'photo_description', 'photo', and 'filename'
<class 'TypeError'>
CRITICAL: Closing network session.

I think that the problem might be on line 385

class TkdialogIC(Tkdialog):
   ...
   def __init__(...)
      super(TkdialogIC, self).__init__()

If the superclass is Tkdialog, it should be super(Tkdialog, self).__init__().

After changing it to super(Tkdialog, self).__init__(), the GUI at least shows up (though some buttons still crash the script).


~/Documents/Mediawiki/Pywikibot/core$ python pwb.py version
Pywikibot: [ssh] pywikibot-core.git (1be0086, g8817, 2017/12/17, 11:06:13, ok)
Release version: 3.0-dev
requests version: 2.18.4
  cacerts: /Library/Python/2.7/site-packages/certifi/cacert.pem
    certificate test: ok
Python: 2.7.10 (default, Jul 15 2017, 17:16:57) 
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]
PYWIKIBOT2_DIR: Not set
PYWIKIBOT2_DIR_PWB: 
PYWIKIBOT2_NO_USER_CONFIG: Not set
Config base dir: /Users/eflyjason/Documents/Mediawiki/Pywikibot/core
Usernames for family "wikipedia":
	test: eflyjason (no sysop configured)
~/Documents/Mediawiki/Pywikibot/core$ python3 pwb.py version
Pywikibot: [ssh] pywikibot-core.git (1be0086, g8817, 2017/12/17, 11:06:13, ok)
Release version: 3.0-dev
requests version: 2.13.0
  cacerts: /usr/local/lib/python3.6/site-packages/requests/cacert.pem
    certificate test: ok
Python: 3.6.3 (default, Oct  4 2017, 06:09:38) 
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)]
PYWIKIBOT2_DIR: Not set
PYWIKIBOT2_DIR_PWB: 
PYWIKIBOT2_NO_USER_CONFIG: Not set
Config base dir: /Users/eflyjason/Documents/Mediawiki/Pywikibot/core
Usernames for family "wikipedia":
	test: eflyjason (no sysop configured)

TASK DETAIL
https://phabricator.wikimedia.org/T183093

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: eflyjason
Cc: Aklapper, pywikibot-bugs-list, eflyjason
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to