Skip to content

Instantly share code, notes, and snippets.

@no-reply
Created September 16, 2014 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save no-reply/ca50c3ca28c17fa927c9 to your computer and use it in GitHub Desktop.
Save no-reply/ca50c3ca28c17fa927c9 to your computer and use it in GitHub Desktop.
unicode error
Sep 16 09:35:38 akara[8157]: [ERROR] Uncaught exception from 'geocode' ('http://purl.org/la/dp/geocode')
Traceback (most recent call last):
File "/home/tjohnson/src/dpla/ingestion/ENV/lib/python2.7/site-packages/akara/multiprocess_http.py", line 304, in _wsgi_application
result = service.handler(environ, start_response_)
File "/home/tjohnson/src/dpla/ingestion/ENV/lib/python2.7/site-packages/akara/services.py", line 417, in wrapper
result = func(*args, **kwargs)
File "/home/tjohnson/src/dpla/ingestion/ENV/lib/python2.7/site-packages/dplaingestion/akamod/geocode.py", line 63, in geocode
place.enrich_geodata(DplaGeonamesGeocoder())
File "/home/tjohnson/src/dpla/ingestion/ENV/lib/python2.7/site-packages/dplaingestion/akamod/geocode.py", line 526, in enrich_geodata
coded_place = geocoder.enrich_place(self)
File "/home/tjohnson/src/dpla/ingestion/ENV/lib/python2.7/site-packages/dplaingestion/akamod/geocode.py", line 309, in enrich_place
new_place = self.geocode_place(place)
File "/home/tjohnson/src/dpla/ingestion/ENV/lib/python2.7/site-packages/dplaingestion/akamod/geocode.py", line 332, in geocode_place
geonames_json = self._name_search(place.name, params)
File "/home/tjohnson/src/dpla/ingestion/ENV/lib/python2.7/site-packages/dplaingestion/akamod/geocode.py", line 437, in _name_search
url = "http://api.geonames.org/searchJSON?%s" % urlencode(params)
File "/usr/lib64/python2.7/urllib.py", line 1332, in urlencode
v = quote_plus(str(v))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xc9' in position 0: ordinal not in range(128
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment