openphoto/frontend — Issue #500: Unicode Characters in fetched json cause importer to bail
Author: ozten
Created: 2012-02-08 15:53:32+00:00
State: open

Processing 163 of 4803 2265744173.json ...
Traceback (most recent call last):
File "import.py", line 82, in
import_into_openphoto(client)
File "import.py", line 39, in import_into_openphoto
resp = client.post('/photo/upload.json', params)
File "/usr/local/lib/python2.6/dist-packages/openphoto-0.1-py2.6.egg/openphoto/__init__.py", line 41, in post
body = urllib.urlencode(params)
File "/usr/lib/python2.6/urllib.py", line 1267, in urlencode
v = quote_plus(str(v))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 12: ordinal not in range(128)

Contents of that file are:
{"description": "Sent from my Internet Arm.", "license": "CC BY-SA", "title": "Chico souffl\u00e9", "dateUploaded": "1203053180", "photo": "http://farm3.staticflickr.com/2222/2265744173_168e28ee8e_o.jpg", "tags": "mobile,foodlog", "dateTaken": "1203024380", "permission": "1", "id": "2265744173"}

Workaround - I am moving these files into a fetched-unicode directory to deal with later.