Page MenuHomePhabricator

-mysqlquery option of is not recognized
Closed, ResolvedPublicBUG REPORT


List of steps to reproduce:
pwb replace -simulate -mysqlquery foo bar -automaticsummary

What happens?:
pagegenerator's -mysqlquery option is used and waits for the sql query to be inputted:
Mysql query string:

if pg option is disabled the script fails:

C:\pwb\GIT\core>pwb replace -simulate -mysqlquery foo bar -automaticsummary
The summary message for the command line replacements will be something like: Bot: Automatisierte Textersetzung  (-foo +bar)
Traceback (most recent call last):
  File "C:\pwb\GIT\core\", line 494, in <module>
  File "C:\pwb\GIT\core\", line 478, in main
    if not execute():
  File "C:\pwb\GIT\core\", line 462, in execute
    run_python_file(filename, script_args, module)
  File "C:\pwb\GIT\core\", line 143, in run_python_file
    exec(compile(source, filename, 'exec', dont_inherit=True),
  File ".\scripts\", line 1072, in <module>
  File ".\scripts\", line 1041, in main
    whereClause = 'WHERE ({})'.format(' OR '.join(
  File ".\scripts\", line 1041, in <genexpr>
    whereClause = 'WHERE ({})'.format(' OR '.join(
TypeError: cannot unpack non-iterable Replacement object
CRITICAL: Exiting due to uncaught exception <class 'TypeError'>

What should have happened instead?: has it's own -mysqlquery option which should be used instead. If no query string is given with -mysqlquery option the default should be used which is described as:

-mysqlquery       Retrieve information from a local database mirror.
                  If no query specified, bot searches for pages with
                  given replacements.

Software version:
Pywikibot 3.0+

Event Timeline

Xqt triaged this task as High priority.

Change 754076 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [bugfix] Enable default -mysqlquery with

Change 754076 merged by Xqt:

[pywikibot/core@master] [bugfix] Enable default -mysqlquery with

It seems that the commit broke the basic functionality of the script.

Change 760896 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] Restore \"[bugfix] Enable default -mysqlquery with\"\"

Change 760896 merged by jenkins-bot:

[pywikibot/core@master] Restore \"[bugfix] Enable default -mysqlquery with\"\"