Bugs item #3611495, was opened at 2013-04-21 05:21 Message generated for change (Comment added) made by russblau You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3611495...
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: rewrite Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nullzer0 (nu11zer0) Assigned to: Russell Blau (russblau) Summary: error when encounter API Warning (Wikidata)
Initial Comment: File "/home/sorawee/rewrite/pywikibot/page.py", line 2340, in editEntity baserevid=baserevid, **kwargs) File "/home/sorawee/rewrite/pywikibot/site.py", line 3365, in editEntity data = req.submit() File "/home/sorawee/rewrite/pywikibot/data/api.py", line 357, in submit % (mod, result["warnings"][mod]["*"])) KeyError: '*'
So I changed api.py to "% (mod, result["warnings"][mod]))", what I get is
WARNING: API warning (messages): {u'0': {u'type': u'warning', u'name': u'edit-no-change'}, u'html': {u'*': u'<p>Your edit was ignored because no change was made to the text.\n</p>'}}
---- Pywikibot branches/rewrite/ (r11404, 2013/04/21, 09:25:43, OUTDATED) Python 2.7.3 (default, Sep 26 2012, 21:53:58) [GCC 4.7.2] unicode test: ok
----------------------------------------------------------------------
Comment By: Russell Blau (russblau)
Date: 2013-05-09 12:43
Message: It seems to me that this is caused by the API module in question returning a warning in a format other than that documented on [[mw:API:Errors and warnings]]. Can you run the script with "-log" flag and attach the log file (or at least the part that results in the KeyError) to this bug report?
----------------------------------------------------------------------
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3611495...