Pywikipedia  (r10475 (wikipedia.py), 2012/08/09, 16:51:37)
wikipedia.py seems to have the same bug in two places.

At lines 2976 and 3145:
    if 'query-continue' in result and getAll:
        params['rvstartid'] = ...

where ... is:
    result['query-continue']['revisions']['rvstartid']

Fix is to change "rvstartid" to "rvcontinue":
    result['query-continue']['revisions']['rvcontinue']

# Demonstrate problem by running following.
# Get a long history list from en.wikipedia.org.
import wikipedia
site = wikipedia.getSite(fam='wikipedia')
page = wikipedia.Page(site, 'Ahalya')
hist = page.getVersionHistory(getAll=True)
print 'len(getVersionHistory()) = %d' % len(hist)

Calling getVersionHistory() raises an exception at line 2977:
    KeyError: 'rvstartid'

That is fixed by making the change shown above; output:
    len(getVersionHistory()) = 1256

John

_______________________________________________
Pywikipedia-l mailing list
Pywikipedia-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l

Reply via email to