Hi,

I've found yesterday, that there are some wrongly defined instances of coordinate datatype in wikidata. For reference check [1].

I guess PWB works properly, but we should be more tolerant right now. For me I've found some workaround:

diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index 12bf9ec..b2044c9 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -163,10 +163,8 @@ class Coordinate(object):
         globes = {}
         for k in site.globes():
             globes[site.globes()[k]] = k
-
-        globekey = data['globe']
-        if globekey:
-            # FIXME: Should probably use get() with some error handling when it
+            globes[k] = k
+        if 'globe' in data:
             globe = globes[data['globe']]
         else:
             # Default to earth or should we use None here?


cheers!


[1] https://www.wikidata.org/wiki/Wikidata:Project_chat#Coordinate_Datatype_misused

--
Tomasz Magulski