basho/riak-python-client — pull request #233 by javajolt (2013-04-02 20:48:48+00:00)
Title: Issue #227: Allow charset encoding in content-type field

Closes Issue #227.

Checks in serialization/deserialization for "charset" encoding inside the character-set field. Also when HTTP object is read, this same check is made.

Problem from #227 below:

Sample error (from master):

johndoe_dict = johndoe.data
File "build/bdist.macosx-10.7-intel/egg/riak/riak_object.py", line 80, in _get_data
File "build/bdist.macosx-10.7-intel/egg/riak/riak_object.py", line 141, in _deserialize
TypeError: No decoder for content type "application/json; charset=UTF-8"
See also http://stackoverflow.com/questions/15489167/objects-stored-by-riak-java-client-end-up-as-raw-json-when-read-by-riak-python-c

The transports need to remove the charset sub-type parameter from the content-type in order for this to work correctly (and possibly set it on the payload or as metadata).