Bugs item #3606741, was opened at 2013-03-04 00:36 Message generated for change (Comment added) made by xqt You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3606741...
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: None Group: None
Status: Closed Resolution: Duplicate
Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody)
Assigned to: xqt (xqt)
Summary: Wikidata: fail to .setitem()
Initial Comment: I failed to setitem when using Page object to create DataPage. For example
page = pywikibot.Page(site, u"xxx") dataPage = pywikibot.DataPage(page) datapage.setitem(u"xxx", items={xxx})
produces an error, while
dataPage = pywikibot.DataPage(1234) datapage.setitem(u"xxx", items={xxx})
works correctly.
Pywikipedia trunk/pywikipedia/ (r11176, 2013/03/03, 17:50:39, ok) Python 2.7.3 (default, Sep 26 2012, 21:53:58) [GCC 4.7.2] config-settings: use_api = True use_api_login = True unicode test: ok
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2013-03-04 05:06
Message: Have a look at the manual: http://www.mediawiki.org/wiki/Manual:Pywikipediabot/Wikidata
You first has to call dataPage.get() or dataPage.exists() before changing the item. This behaviour is alread know by an other bug tracker.
----------------------------------------------------------------------
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3606741...
pywikipedia-bugs@lists.wikimedia.org