Page MenuHomePhabricator

Clean up limit handling (data/api.py)
Closed, ResolvedPublic

Description

QueryGenerator has a very complicated structure to handle request limit handling; some of it is currently working by accident, e.g.:

new_limit = None
(...)
new_limit = min(new_limit, self.api_limit // 10, 250)

Now, new_limit is what? None!
(at least, on python 2 -- this returns an error in python 3)

Which is actually required as some requests don't allow limits, such as

https://en.wikipedia.org/w/api.php?maxlag=5&pageids=1969218|225758|38275275|34684|34550&uiprop=hasmsg|blockinfo&rvprop=ids|flags|timestamp|comment|content&prop=revisions|info|categoryinfo&meta=userinfo&action=query&format=json

adding &rvlimit=50 returns

error: {
code: "rvmultpages",
info: "titles, pageids or a generator was used to supply multiple pages, but the limit, startid, endid, dirNewer, user, excludeuser, start and end parameters may only be used on a single page."
}


Version: core-(2.0)
Severity: major

Details

Reference
bz64489

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:08 AM
bzimport set Reference to bz64489.
bzimport added a subscriber: Unknown Object (????).
Xqt claimed this task.

I guess this is already fixed with https://gerrit.wikimedia.org/r/#/c/130019/