I have a JSON object that was saved to a file using the repr function:
f = open('file', 'w')
f.write(repr(my_json))
f.close()
The encoded JSON now has leading 'u' characters indicating unicode encoding.
{u'messages': 'messages'}
This is expected Python 2.x behavior, but now I'm trying to figure out how to decode the string stored in that file. Everything I've tried has given me the same error:
ValueError: Expecting property name: line 1 column 2 (char 1)
Help?
json.dumps?f.writewhich python version are you using?