@Xqt, I do not know whether this is a bug or an issue on my side, therefore here and not in Phabricator:
I’ve added this to user-fixes.py:
fixes['ampCode'] = { 'generator': [ r'-ns:0', r'-search:insource:"%26" insource:/%26/', ], 'regex': False, 'msg': { '_default': 'Bot-Änderung: überflüss. Kodierung für [[Und-Zeichen]] ersetzt, vgl. [[Spezial:Diff/233908956|Anfrage]]', }, 'replacements': [ (r' %26 ', ' & '), ] }
and then started Pywikibot with this (Windows) command line (user is pre-configured):
pwb replace -simulate -lang:de -fix:ampCode -log:fix-ampCode.log
This resulted in this error message:
2023-05-24 00:40:34 http.py, 123 in flush: VERBOSE Traceback (most recent call last): File "C:\Programs\Netz\pywikibot\pwb.py", line 39, in <module> sys.exit(main()) ^^^^^^ File "C:\Programs\Netz\pywikibot\pwb.py", line 35, in main runpy.run_path(str(path), run_name='__main__') File "<frozen runpy>", line 291, in run_path File "<frozen runpy>", line 98, in _run_module_code File "<frozen runpy>", line 88, in _run_code File "C:\Programs\Netz\pywikibot\pywikibot\scripts\wrapper.py", line 514, in <module> main() File "C:\Programs\Netz\pywikibot\pywikibot\scripts\wrapper.py", line 498, in main if not execute(): ^^^^^^^^^ File "C:\Programs\Netz\pywikibot\pywikibot\scripts\wrapper.py", line 485, in execute run_python_file(filename, script_args, module) File "C:\Programs\Netz\pywikibot\pywikibot\scripts\wrapper.py", line 147, in run_python_file exec(compile(source, filename, 'exec', dont_inherit=True), File "C:\Programs\Netz\pywikibot\scripts\replace.py", line 1113, in <module> main() File "C:\Programs\Netz\pywikibot\scripts\replace.py", line 1008, in main if not fix['replacements']: ~~~^^^^^^^^^^^^^^^^ TypeError: tuple indices must be integers or slices, not str 2023-05-24 00:40:34 http.py, 132 in flush: CRITICAL Exiting due to uncaught exception TypeError: tuple indices must be integers or slices, not str
Used Pywikibot version is:
Release version: 8.1.2 setuptools version: 65.5.0 mwparserfromhell version: 0.6.3 wikitextparser version: 0.51.1 requests version: 2.28.1
With explicit command line options the task worked then, the call was:
pwb replace -simulate -lang:de -ns:0 -search:"insource:\"%26\" insource:/ %26 /" -summary:"Bot-Änderung: überflüss. Kodierung für [[Und-Zeichen]] ersetzt, vgl. [[Spezial:Diff/233908956|Anfrage]]" -log:fix-ampCode.log " %26 " " & "