Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeEncodeError: 'ascii' codec can't encode character #4

Open
d6y opened this issue Feb 5, 2012 · 3 comments
Open

UnicodeEncodeError: 'ascii' codec can't encode character #4

d6y opened this issue Feb 5, 2012 · 3 comments

Comments

@d6y
Copy link

d6y commented Feb 5, 2012

Hello! Thanks for this tool. I just tried it and encountered a few problems. The 500 errors are a bit of an issue, but the last one gave a message I thought might be useful.... (keys and secrets omitted).

openphoto-import (master)$ python import.py --host=d6y.openphoto.me --consumer-key=xx --consumer-secret=xx --token=xx --token-secret=xx
Found a total of 1577 files to process
Processing 1 of 1577 1010505223.json ... FAILED: 500 - An unknown error occurred.
Processing 2 of 1577 1010506241.json ... FAILED: 500 - An unknown error occurred.
Processing 3 of 1577 1011363856.json ... FAILED: 500 - An unknown error occurred.
Processing 4 of 1577 1011364722.json ... FAILED: 500 - An unknown error occurred.
Processing 5 of 1577 1058682439.json ... FAILED: 500 - An unknown error occurred.
Processing 6 of 1577 1059547820.json ... FAILED: 500 - An unknown error occurred.
Processing 7 of 1577 1059549012.json ... FAILED: 500 - An unknown error occurred.
Processing 8 of 1577 1059550908.json ...
Traceback (most recent call last):
  File "import.py", line 79, in <module>
    import_into_openphoto(client)
  File "import.py", line 37, in import_into_openphoto
    resp = client.post('/photo/upload.json', params)
  File "/Library/Python/2.7/site-packages/openphoto-0.1-py2.7.egg/openphoto/__init__.py", line 41, in post
    body = urllib.urlencode(params)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 1294, in urlencode
    v = quote_plus(str(v))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf4' in position 1: ordinal not in range(128)


openphoto-import (master)$ more fetched/1059550908.json 
{"description": "H\u00f4tel Colbert, I think.  \n<a href=\"http://en.wikipedia.org/wiki/Saint-Omer\">en.wikipedia.org/wiki/Saint-Omer</a>", "license": "", "title": "Saint Omer", "dateUploaded": "1186648402", "photo": "http://farm2.staticflickr.com/1395/1059550908_ef47d97191_o.jpg", "permission": "1", "longitude": "2.253087", "dateTaken": "1186648402", "latitude": "50.749005", "id": "1059550908", "tags": "flickr:place_id=Mw_SImRQULzqjJpumA"}

Here's an example of one of the 500:

 {"license": "", "tags": "", "dateUploaded": "1186265418", "photo": "http://farm2.staticflickr.com/1134/1010505223_e994225f4a_o.jpg", "title": "an end to slow cheese", "dateTaken": "1186265418", "permission": "1", "id": "1010505223"}
@jmathai
Copy link
Member

jmathai commented Feb 5, 2012

This is an issue being tracked here openphoto/openphoto-python#7. Will keep this open as a tracking issue.

@sneakypete81
Copy link
Contributor

@d6y: can you please confirm that this is working now?

The openphoto-python library has been renamed to "trovebox", so you'll need to install this first:

   sudo pip install trovebox

See the updated readme for more details.

@d6y
Copy link
Author

d6y commented Jul 29, 2013

Bare with me: I'll need to set up a new account and try out an import. May take a few days. (The importer in Trovebox imported my Flickr photos without problem some time ago).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants