When I use two legitimate addresses, varying only by a street number, one works and one fails.
Works: s.address = "2021 Cap Rock, Richardson, TX 75080"
(without zipcode also works)
Fails: s.address = "2044 Cap Rock, Richardson, TX 75080"
in ()
----> 1 s.address = "2044 Cap Rock, Richardson, TX 75080"
/Users/john/.venv/mm/lib/python2.7/site-packages/address/models.pyc in set(self, inst, value)
330
331 def set(self, inst, value):
--> 332 super(AddressDescriptor, self).set(inst, to_python(value))
333
334
/Users/john/.venv/mm/lib/python2.7/site-packages/address/models.pyc in to_python(value, instance, address_model, component_model, geolocator)
169 # if that fails then store directly.
170 elif isinstance(value, string_types):
--> 171 return lookup(value, instance, address_model, component_model, geolocator)
172
173 # A dictionary of named address components.
/Users/john/.venv/mm/lib/python2.7/site-packages/address/models.pyc in lookup(address, instance, address_model, component_model, geolocator)
201 else:
202 return address_model.objects.create(formatted=address)
--> 203 return to_python(location.raw, instance, component_model)
204
205
/Users/john/.venv/mm/lib/python2.7/site-packages/address/models.pyc in to_python(value, instance, address_model, component_model, geolocator)
176 # Attempt a conversion.
177 try:
--> 178 return _to_python(value, instance, address_model, component_model)
179 except InconsistentDictError:
180 formatted = value.get('formatted_address', None)
/Users/john/.venv/mm/lib/python2.7/site-packages/address/models.pyc in _to_python(value, instance, address_model, component_model)
54 kind_table = {}
55 for comp in components:
---> 56 kinds = [KEY_KIND_TABLE[k] for k in comp.get('types', [])]
57 kind = reduce(lambda x,y: x|y, kinds, 0)
58 short_name = comp.get('short_name', '')
KeyError: u'postal_code_suffix'