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
I found some others too. Fixed in r10485, code duplication removed in r10486.
Regards xqt
----- Original Nachricht ---- Von: Johnuniq wp.johnuniq@gmail.com An: pywikipedia-l@lists.wikimedia.org Datum: 15.08.2012 13:20 Betreff: [Pywikipedia-l] Fix for wikipedia.py getVersionHistory
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
pywikipedia-l@lists.wikimedia.org