This code:
import json s = \'{ \"key1\": \"value1\", \"key2\": \"value2\", }\' json.loads(s)
produces this error in Python 2:
Another option is to parse it as YAML; YAML accepts valid JSON but also accepts all sorts of variations.
import yaml s = '{ "key1": "value1", "key2": "value2", }' yaml.load(s)