Page MenuHomePhabricator

Bot crashes on malllformed coordinates api output
Closed, ResolvedPublic

Description

We ask the api for the name, but it isn't actually returned at https://pl.wikipedia.org/w/api.php?action=query&prop=coordinates&titles=Bamb%C3%BA_%28metro_w_Madrycie%29&coprop=type|name|dim|country|region|globe&format=json

File "C:\pywikibot\core\pywikibot\page.py", line 1164, in coordinates
  self.site.loadcoordinfo(self)
File "C:\pywikibot\core\pywikibot\site.py", line 1369, in loadcoordinfo
  api.update_page(page, pageitem)
File "C:\pywikibot\core\pywikibot\data\api.py", line 1009, in update_page
  name=co['name'],

KeyError: 'name'
<type 'exceptions.KeyError'>

Filed an api bug at https://bugzilla.wikimedia.org/show_bug.cgi?id=62118 , but we should probably patch up the bot too to be able to handle missing properties.


Version: core-(2.0)
Severity: normal

Details

Reference
bz62119