Last modified: 2014-09-09 02:23:30 UTC
Trying to save using -search or -filelinks is giving error (extract below) arjun@arjun-945GCM-S2L:~/pwb/core$ python pwb.py replace.py -filelinks:CNREDDY.JPG -save:cnrtoc.txt "అ" "ఇ" Traceback (most recent call last): File "pwb.py", line 104, in <module> run_python_file(fn, args) File "pwb.py", line 49, in run_python_file exec compile(source, filename, "exec") in main_mod.__dict__ File "scripts/replace.py", line 696, in <module> main() File "scripts/replace.py", line 549, in main raise pywikibot.Error, 'require even number of replacements.' pywikibot.exceptions.Error: require even number of replacements. It is working with just the first search string. Looks like the documentation (link below) is outof date. https://www.mediawiki.org/wiki/Manual:Pywikibot/replace.py#Example: Gathering articles
Search argument behavior is not as per expectations $python pwb.py replace.py -search:CNREDDY.JPG -save:cnrtoc.txt "అ" "ఇ" Traceback (most recent call last): File "pwb.py", line 104, in <module> run_python_file(fn, args) File "pwb.py", line 49, in run_python_file exec compile(source, filename, "exec") in main_mod.__dict__ File "scripts/replace.py", line 696, in <module> main() File "scripts/replace.py", line 549, in main raise pywikibot.Error, 'require even number of replacements.' pywikibot.exceptions.Error: require even number of replacements.
Neighter -search nor -save are valid option for replace.py on core. Please refer the documentation of the code by pwb.py replace -help
Sorry, -search option is quite right but -save option is available on compat version only (yet).
Reopened as feature request