Page MenuHomePhabricator

nowcommons.py throws an error on enwiki
Closed, ResolvedPublicBUG REPORT

Description

$ python pwb.py nowcommons -lang:en -site:wikipedia -user:DvorapaBot -simulate
Retrieving 2 pages from wikipedia:en.


>>> File:Alaskan ADIZ.jpg <<<
Traceback (most recent call last):
  File "pwb.py", line 298, in <module>
    if not main():
  File "pwb.py", line 293, in main
    run_python_file(filename, [filename] + args, argvu, file_package)
  File "pwb.py", line 96, in run_python_file
    main_mod.__dict__)
  File "./scripts/nowcommons.py", line 408, in <module>
    main()
  File "./scripts/nowcommons.py", line 404, in main
    bot.run()
  File "./scripts/nowcommons.py", line 273, in run
    filenameOnCommons = self.findFilenameOnCommons(localImagePage)
  File "./scripts/nowcommons.py", line 243, in findFilenameOnCommons
    filenameOnCommons = par[par.index(':') + 1:]
ValueError: substring not found
CRITICAL: Exiting due to uncaught exception <class 'ValueError'>

Event Timeline

Dvorapa created this task.May 16 2019, 8:50 PM
Restricted Application added a project: Pywikibot. · View Herald TranscriptMay 16 2019, 8:50 PM
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald Transcript
Dvorapa updated the task description. (Show Details)May 16 2019, 8:50 PM

Change 588016 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [bugfix] use str.find instead of str.index within nowcommons.py

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

Xqt claimed this task.Apr 10 2020, 4:35 PM
Xqt triaged this task as Medium priority.

Change 588016 merged by jenkins-bot:
[pywikibot/core@master] [bugfix] use str.find instead of str.index within nowcommons.py

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

Xqt closed this task as Resolved.Apr 12 2020, 5:10 AM
Xqt changed the subtype of this task from "Task" to "Bug Report".