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
--------------------------
**Version**: core-(2.0)
**Severity**: major