[bugs:#1660] Can't set claim target due to an AttributeError

Status: closed-fixed
Created: Thu Aug 29, 2013 09:44 AM UTC by Wieland Hoffmann
Last Updated: Thu Aug 29, 2013 03:43 PM UTC
Owner: Legoktm

Executing the following code

import pywikibot as wp
s = wp.Site('wikidata', 'wikidata')
d = s.data_repository()
m = wp.ItemPage(d, 'Q14005')
c = wp.Claim(s, "P248")
c.setTarget(m)

results in a short traceback ending in "AttributeError: APISite instance has no attribute 'getPropertyType'". According to git bisect, the first commit showing this behaviour is 8f1c2631215b340acf962ae1a0fa7ffcefe84df5 (or svn revision 11600).

Output from python version.py:

Pywikibot: [ssh] pywikibot/core (r1995, fa7a248, 2013/08/28, 22:33:44, ok)
Release version: 2.0b1
Python: 2.7.5 (default, May 12 2013, 12:00:47) 
[GCC 4.8.0 20130502 (prerelease)]
unicode test: ok

Sent from sourceforge.net because Pywikipedia-bugs@lists.wikimedia.org is subscribed to https://sourceforge.net/p/pywikipediabot/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/pywikipediabot/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.