Last modified: 2014-11-09 13:30:22 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T74093, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 72093 - commands with colon fails
commands with colon fails
Status: RESOLVED FIXED
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
core-(2.0)
All All
: Unprioritized critical
: ---
Assigned To: Pywikipedia bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-10-15 20:34 UTC by JAn Dudík
Modified: 2014-11-09 13:30 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description JAn Dudík 2014-10-15 20:34:15 UTC
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>
Comment 1 Mpaa 2014-10-15 20:51:18 UTC
The workaround is to use Kategorie.

python pwb.py newitem -catr:Kategorie:údržba:Wikidata -lang:cs -simulate
Comment 2 Gerrit Notification Bot 2014-10-15 22:11:52 UTC
Change 166897 had a related patch set uploaded by XZise:
[FIX] Site: Use unicode for errors with iw prefix

https://gerrit.wikimedia.org/r/166897
Comment 3 Gerrit Notification Bot 2014-10-15 22:41:09 UTC
Change 166903 had a related patch set uploaded by Mpaa:
Bug 72093 - commands with colon fails

https://gerrit.wikimedia.org/r/166903
Comment 4 Gerrit Notification Bot 2014-10-15 23:05:09 UTC
Change 166897 merged by jenkins-bot:
[FIX] Site: Use unicode for errors with iw prefix

https://gerrit.wikimedia.org/r/166897
Comment 5 John Mark Vandenberg 2014-11-09 13:30:22 UTC
This appears to be solved (the command in comment 0 generates pages).

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links