UnicodeDecodeError when using file-like objects with unicode name. #10

merged 3 commits into from Dec 20, 2011


None yet
2 participants

snoack commented Dec 19, 2011

Currently you get a UnicodeDecodeError when using faces_detect() or faces_recognize() with a file-like object whose name attribute is a unicode object.

client = face_client.FaceClient(...)
client.faces_detect(file=open(u'...', 'r'))

That is fixed with 970457f, now. Furthermore I have cleaned up the code for file-like object support (42a66c7) and added a .gitignore file (da79177).

snoack added some commits Dec 19, 2011

Used consecutive instead of random filenames for anonymous files.
That way it is more robust against clashing file/field names and less code to maintain.
Convert headers to str. Otherwise if some headers are given as unicod…
…e, it would

try to decode any other data in the mutlipart response when concatenating, which
will usually fail, as image data can't be decoded as ascii text.

Kami added a commit that referenced this pull request Dec 20, 2011

Merge pull request #10 from wallunit/master
UnicodeDecodeError when using file-like objects with unicode name.

@Kami Kami merged commit 5ff153b into Kami:master Dec 20, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment