https://bugzilla.wikimedia.org/show_bug.cgi?id=71817
Bug ID: 71817 Summary: if [[file:]] exists in the page Cosmetic changes.py will crash Product: Pywikibot Version: core (2.0) Hardware: All OS: All Status: NEW Severity: major Priority: Unprioritized Component: Cosmetic changes Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: reza.energy@gmail.com Web browser: --- Mobile Platform: ---
If [[file:]] (or other namespaces) exists in the page Cosmetic_changes.py will crash The error:
Traceback (most recent call last): File "pwb.py", line 164, in <module> run_python_file(fn, argv, argvu) File "pwb.py", line 69, in run_python_file exec(compile(source, filename, "exec"), main_mod.__dict__) File "scripts/cosmetic_changes.py", line 971, in <module> main() File "scripts/cosmetic_changes.py", line 965, in main bot.run() File "/home/reza/pycore/pywikibot/bot.py", line 939, in run self.treat(page) File "scripts/cosmetic_changes.py", line 904, in treat changedText = ccToolkit.change(page.get()) File "scripts/cosmetic_changes.py", line 228, in change new_text = self._change(text) File "scripts/cosmetic_changes.py", line 221, in _change text = self.safe_execute(method, text) File "scripts/cosmetic_changes.py", line 199, in safe_execute result = method(text) File "scripts/cosmetic_changes.py", line 548, in cleanUpLinks 'startspace']) File "/home/reza/pycore/pywikibot/textlib.py", line 224, in replaceExcept replacement = new(match) File "scripts/cosmetic_changes.py", line 442, in handleOneLink namespace = page.namespace() File "/home/reza/pycore/pywikibot/page.py", line 154, in namespace return self._link.namespace File "/home/reza/pycore/pywikibot/page.py", line 4160, in namespace self.parse() File "/home/reza/pycore/pywikibot/page.py", line 4137, in parse % self._text) pywikibot.exceptions.Error: Invalid link (no page title): 'file:' <class 'pywikibot.exceptions.Error'> CRITICAL: Waiting for 1 network thread(s) to finish. Press ctrl-c to abort
https://bugzilla.wikimedia.org/show_bug.cgi?id=71817
--- Comment #1 from reza1615 reza.energy@gmail.com --- case: http://fa.wikipedia.org/w/index.php?title=%DA%A9%D8%A7%D8%B1%D8%A8%D8%B1:Yam...
https://bugzilla.wikimedia.org/show_bug.cgi?id=71817
--- Comment #2 from Fabian CommodoreFabianus@gmx.de --- Okay https://gerrit.wikimedia.org/r/161671/ does indirectly fix this. The problem is that Link.parse() raises an Error and not InvalidTitle exception. If it'd raise an InvalidTitle, cosmetic_changes.py would work fine.
https://bugzilla.wikimedia.org/show_bug.cgi?id=71817
John Mark Vandenberg jayvdb@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |testme
--- Comment #3 from John Mark Vandenberg jayvdb@gmail.com --- Iec4f32fdefde15b2330dbb191fb3bbb0d04803e2 was merged. We should add a test case for this, if one doesnt already exist.
pywikipedia-bugs@lists.wikimedia.org