Page MenuHomePhabricator

image.py fails on image removals at Meta
Closed, ResolvedPublic

Description

F:\MWDEV\pywikibot-core>pwb.py image "Borbera (mwlib).pdf"
WARNING: Bot.site was not set before being retrieved.
WARNING: Using the default site: meta:meta
WARNING: .\scripts\image.py:132: _NotImplementedWarning: parameters not being a mapping is deprecated.
  fallback=True)

Traceback (most recent call last):
  File "F:\MWDEV\pywikibot-core\pwb.py", line 255, in <module>
    if not main():
  File "F:\MWDEV\pywikibot-core\pwb.py", line 249, in main
    run_python_file(filename, [filename] + args, argvu, file_package)
  File "F:\MWDEV\pywikibot-core\pwb.py", line 121, in run_python_file
    main_mod.__dict__)
  File ".\scripts\image.py", line 209, in <module>
    main()
  File ".\scripts\image.py", line 201, in main
    bot = ImageRobot(preloadingGen, old_image, new_image, **options)
  File ".\scripts\image.py", line 132, in __init__
    fallback=True)
  File "F:\MWDEV\pywikibot-core\pywikibot\i18n.py", line 512, in translate
    plural_parameters = _PluralMappingAlias(parameters)
  File "F:\MWDEV\pywikibot-core\pywikibot\i18n.py", line 410, in __init__
    source = int(source)
ValueError: invalid literal for int() with base 10: 'Borbera (mwlib).pdf'
<class 'ValueError'>
CRITICAL: Closing network session.

Without quotes:

F:\MWDEV\pywikibot-core>pwb.py image Borbera (mwlib).pdf
WARNING: Bot.site was not set before being retrieved.
WARNING: Using the default site: meta:meta
WARNING: .\scripts\image.py:132: _NotImplementedWarning: parameters not being a mapping is deprecated.
  fallback=True)

Event Timeline

@MarcoAurelio can you check if you get this with the latest pywikibot code ? There is a commit on https://gerrit.wikimedia.org/r/#/c/282195/ which should have solved it.

Xqt triaged this task as Medium priority.Sep 24 2016, 5:59 PM

@MarcoAurelio can you check if you get this with the latest pywikibot code ? There is a commit on https://gerrit.wikimedia.org/r/#/c/282195/ which should have solved it.

Yes, it works now. Thank you very much and to @Ladsgroup too.

That said, I continue receiving:

F:\MWDEV\pywikibot-core>pwb.py image "Senior picture.jpg"
WARNING: Bot.site was not set before being retrieved.
WARNING: Using the default site: meta:meta
Retrieving 1 pages from meta:meta.
WARNING: Bot.site was not set before being retrieved.
WARNING: Using the default site: meta:meta

Although the script later works.

Agree, that's a bit irritating, but as it's warnings it is not fatal.
I've created the task T146580 which will look into removing those warnings for image.py

Closing this task.