This issue was converted from https://jira.toolserver.org/browse/DRTRIGON-90.
Summary: sequence of sometimes occuring "KeyError: u'parse'"
Issue type: Sub-task - The sub-task of the issue
Priority: Minor
Status: In Progress
Assignee: drtrigon <dr.trigon@surfeu.ch>
From: drtrigon <dr.trigon@surfeu.ch>
Date: Sat, 09 Jul 2011 11:14:57
The error:
Traceback (most recent call last):
File "/home/drtrigon/pywikipedia/bot_control.py", line 225, in run
self.bot.main()
File "/home/drtrigon/pywikipedia/sum_disc.py", line 1307, in main
bot.run()
File "/home/drtrigon/pywikipedia/sum_disc.py", line 369, in run
self.getLatestRelevantNews()
File "/home/drtrigon/pywikipedia/sum_disc.py", line 747, in getLatestRelevantNews
entries = PageSections(page, self._param)
File "/home/drtrigon/pywikipedia/sum_disc.py", line 1138, in init
sections = page.getSections(minLevel=1)
File "/home/drtrigon/pywikipedia/dtbext/dtbext_wikipedia.py", line 50, in <lambda>
obj.dict[\'getSections\'] = lambda *args, kwds: Page.dict[\'getSections\'](obj, *args, kwds)
File "/home/drtrigon/pywikipedia/dtbext/dtbext_wikipedia.py", line 160, in getSections
r = result[u\'parse\'][u\'sections\']
KeyError: u'parse'
occurs from time to time - look at [1] and older changes. As temporary work-a-round the error raised is converted to
pywikibot.Error('Problem occured during data retrieval for sections in %s!' % self.title(asLink=True))
and the 'result' dict gets printed into the log file to be able to track the origin of this down.
In future there should be a final solution to this bug:
- either keep the current code (without the print) which converts the error such that later the whole page gets processed in one part (fall back)
- or add a loop with e.g. maximal 3 re-tries (like for low level url retrieval) and then use e.g. the same fall back like before
[1] http://de.wikipedia.org/w/index.php?title=Benutzer:DrTrigonBot/Status&direction=prev&oldid=90413407
Version: unspecified
Severity: minor