Instagram/python-instagram — pull request #13 by akumria (2012-02-16 18:25:28+00:00)
Title: Not all Locations have latitude / longitude.

Check for that before constructing the Point

Without this small fix, repeatedly doing a query will eventually result in:

>>> from instagram.client import InstagramAPI
>>> instagram_api = InstagramAPI(**{'client_id': 'something', 'client_secret': 'hidden'})
>>> instagram_api.media_popular()
Traceback (most recent call last):
File "", line 1, in
File "instagram/bind.py", line 130, in _call
return method.execute()
File "instagram/bind.py", line 121, in execute
content, next = self._do_api_request(url, method, body, headers)
File "instagram/bind.py", line 97, in _do_api_request
obj = self.root_class.object_from_dictionary(entry)
File "instagram/models.py", line 49, in object_from_dictionary
new_media.location =
Location.object_from_dictionary(entry['location'])
File "instagram/models.py", line 95, in object_from_dictionary
if entry['latitude']:
KeyError: 'latitude'
>>>