https://bugzilla.wikimedia.org/show_bug.cgi?id=55689
Web browser: --- Bug ID: 55689 Summary: Replace.py errors Product: Pywikibot Version: core (2.0) Hardware: All OS: All Status: NEW Severity: normal Priority: Unprioritized Component: General Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: arjunaraoc@googlemail.com Classification: Unclassified Mobile Platform: ---
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