Last modified: 2012-02-18 18:07:12 UTC
Querying API blocklist may result in an infinite loop if there are more blocks in the same second than given bklimit. Test to reproduce: try query blocklist of Hungarian Wikipedia by 5 blocks. At 2010-03-05T17:52:44Z it will get into an infinite loop because there are 7 blocks at that second (from block id 6456 to 6462). Use ctrl F here: https://hu.wikipedia.org/w/api.php?action=query&list=blocks&bklimit=1000 My code using Pywikipedia: http://pastebin.com/7UU0bT4f
An additional problem: the smaller limit you use, the greater is the possibility to get fake duplicates. E.g. block id=n and block id=n+1 have the same timestamp, end the first run ends with nth. You get back a timestamp for n+1st item, but using it will display nth item repeatedly. So every query is subject to have duplicates. The easy solution would be to use block id instead of bkstart in query-continue.
Created attachment 9939 [details] Source from pastebin Made the source an attachment here.
https://hu.wikipedia.org/w/api.php?action=query&list=blocks&bklimit=7&bkstart=1267811564 -- better link to the example blocklist
*** This bug has been marked as a duplicate of bug 24782 ***