Based on this post 2 it seems you are trying to encode/decode an invalid character. What seems to be  bit weird is that apparently a JSON file is expected (_dict_from_json_file is used), so my guess would be that the decoder tries to decode a wrong file format.