https://bugzilla.wikimedia.org/show_bug.cgi?id=72093
Bug ID: 72093 Summary: commands with colon fails Product: Pywikibot Version: core (2.0) Hardware: All OS: All Status: NEW Severity: critical Priority: Unprioritized Component: General Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: jan.dudik@gmail.com Web browser: --- Mobile Platform: ---
When running script with pagegenerators containing character ":", bot fails:
I:\py\rewrite>pwb.py newitem -catr:údržba_Wikipedie Retrieving 50 pages from wikipedia:cs.
Wikipedie:Požadované články <<<
[[cs:Wikipedie:Požadované články]] already has an item: [[wikidata:Q4664111]]. ...
I:\py\rewrite>pwb.py newitem -catr:údržba:Wikidata Traceback (most recent call last): File "I:\py\rewrite\pwb.py", line 164, in <module> run_python_file(fn, argv, argvu) File "I:\py\rewrite\pwb.py", line 69, in run_python_file exec(compile(source, filename, "exec"), main_mod.__dict__) File "I:\py\rewrite\scripts\newitem.py", line 149, in <module> main() File "I:\py\rewrite\scripts\newitem.py", line 135, in main elif gen.handleArg(arg): File "I:\py\rewrite\pywikibot\pagegenerators.py", line 415, in handleArg gen = self.getCategoryGen(arg, len('-catr'), recurse=True) File "I:\py\rewrite\pywikibot\pagegenerators.py", line 283, in getCategoryGen defaultNamespace=14)) File "I:\py\rewrite\pywikibot\tools.py", line 529, in wrapper return obj(*__args, **__kw) File "I:\py\rewrite\pywikibot\page.py", line 1951, in __init__ if self.namespace() != 14: File "I:\py\rewrite\pywikibot\page.py", line 158, in namespace return self._link.namespace File "I:\py\rewrite\pywikibot\page.py", line 4141, in namespace self.parse() File "I:\py\rewrite\pywikibot\page.py", line 4050, in parse newsite = self._site.interwiki(prefix) File "I:\py\rewrite\pywikibot\site.py", line 600, in interwiki "'{0}' is not an interwiki prefix.".format(prefix)) UnicodeEncodeError: 'ascii' codec can't encode character u'\xfa' in position 0: ordinal not in range(128) <type 'exceptions.UnicodeEncodeError'> CRITICAL: Waiting for 1 network thread(s) to finish. Press ctrl-c to abort
I:\py\rewrite>