json.dump throwing "TypeError: {...} is not JSON serializable" on seemingly valid object?

The Solution to json.dump throwing "TypeError: {...} is not JSON serializable" on seemingly valid object? is


Because it's not actually a dictionary; it's another mapping type that looks like a dictionary. Use type() to verify. Pass it to dict() to get a real dictionary from it.

~ Answered on 2012-06-03 17:57:07


Most Viewed Questions: