Last modified: 2014-06-09 13:07:56 UTC
If total parameter is None, the generator sometimes does not yield any pages but gives an 503 status error: >>> import pwb >>> import pywikibot as py >>> s = py.Site('commons', 'commons') >>> c = py.Category(s, 'Korea.net_photos_to_check') >>> for p in c.articles(total=10, content=False, recurse=False, step=None): print p.title() File:Kim Yu-na G20 Seoul Summit Ambassador.jpg File:KOCIS 150m-long kimbap (5911816764).jpg File:KOCIS 150m-long kimbap (5911817226).jpg File:KOCIS 2010 UNESCO World Conference of Arts Education (4640759629).jpg File:KOCIS 2010 UNESCO World Conference of Arts Education (4641367198).jpg File:KOCIS 2010 UNESCO World Conference of Arts Education (4641367274).jpg File:KOCIS 2010 UNESCO World Conference of Arts Education (4641367322).jpg File:KOCIS 2012 Yeosu Expo (7548642068).jpg File:KOCIS 2012 Yeosu Expo (7548642206).jpg File:KOCIS 38th Annual Los Angeles Korean Festival (6301325981).jpg whereas total=None fails into 503 loop >>> for p in c.articles(total=None, content=False, recurse=False, step=None): print p.title() WARNING: Http response status 503 WARNING: Non-JSON response received from server commons:commons; the server may be down. Set gcmlimit = 2500 WARNING: Waiting 5 seconds before retrying. Traceback (most recent call last): File "<pyshell#20>", line 1, in <module> for p in c.articles(total=None, content=False, recurse=False, step=None): File "pywikibot\page.py", line 1909, in articles endsort=endsort File "pywikibot\data\api.py", line 719, in __iter__ self.data = self.request.submit() File "pywikibot\data\api.py", line 306, in submit body=paramstring) File "pywikibot\comms\http.py", line 144, in request time.sleep(0.1) KeyboardInterrupt >>>
Hm, when the gcmlimit starts with ~3000 or higher this error occurs. Wenn the limit is ~2500 or lower it doesn't. Unfortunately it doesn't disappear by just downsizing the limit as the QueryGenerator does.
Change 137936 had a related patch set uploaded by Xqt: (bug 66256) decrease api high limit https://gerrit.wikimedia.org/r/137936
Change 137936 merged by jenkins-bot: (bug 66256) decrease api high limit and update the paramstring https://gerrit.wikimedia.org/r/137936