Adding in if isinstance(d, unicode): d = {'id':d} Seems suspect. It means that something was supposed to be a dictionary, but showed up as unicode. I would expect you to have to convert to string and then to JSON.
Adding in
if isinstance(d, unicode):
d = {'id':d}
Seems suspect. It means that something was supposed to be a dictionary, but showed up as unicode. I would expect you to have to convert to string and then to JSON.