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\pwb.py", line 494, in <module>
main()
File "C:\pwb\GIT\core\pwb.py", line 478, in main
if not execute():
File "C:\pwb\GIT\core\pwb.py", line 462, in execute
run_python_file(filename, script_args, module)
File "C:\pwb\GIT\core\pwb.py", line 143, in run_python_file
exec(compile(source, filename, 'exec', dont_inherit=True),
File ".\scripts\replace.py", line 1072, in <module>
main()
File ".\scripts\replace.py", line 1041, in main
whereClause = 'WHERE ({})'.format(' OR '.join(
File ".\scripts\replace.py", 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?:
replace.py 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+