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
https://bugzilla.wikimedia.org/show_bug.cgi?id=55689
--- Comment #1 from Arjuna Rao Chavala arjunaraoc@googlemail.com --- 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.
https://bugzilla.wikimedia.org/show_bug.cgi?id=55689
xqt info@gno.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |UNCONFIRMED CC| |info@gno.de Ever confirmed|1 |0
--- Comment #2 from xqt info@gno.de --- Neighter -search nor -save are valid option for replace.py on core. Please refer the documentation of the code by pwb.py replace -help
https://bugzilla.wikimedia.org/show_bug.cgi?id=55689
--- Comment #3 from xqt info@gno.de --- Sorry, -search option is quite right but -save option is available on compat version only (yet).
https://bugzilla.wikimedia.org/show_bug.cgi?id=55689
xqt info@gno.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID
https://bugzilla.wikimedia.org/show_bug.cgi?id=55689
xqt info@gno.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Priority|Unprioritized |Low Status|RESOLVED |REOPENED Resolution|INVALID |--- Ever confirmed|0 |1 Severity|normal |enhancement
--- Comment #4 from xqt info@gno.de --- Reopened as feature request
https://bugzilla.wikimedia.org/show_bug.cgi?id=55689
John Mark Vandenberg jayvdb@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jayvdb@gmail.com Component|General |Other scripts
pywikipedia-bugs@lists.wikimedia.org