diff --git a/simplejson/decoder.py b/simplejson/decoder.py index e205a697dcf757c138188eeeb516c90772b4d89a_c2ltcGxlanNvbi9kZWNvZGVyLnB5..8cda38283e68c17241d4a1f9eca80c4af5be1a17_c2ltcGxlanNvbi9kZWNvZGVyLnB5 100644 --- a/simplejson/decoder.py +++ b/simplejson/decoder.py @@ -138,6 +138,8 @@ value, end = iterscan(s, idx=end, context=context).next() except StopIteration: raise ValueError(errmsg("Expecting object", s, end)) + if key in pairs: + raise ValueError(errmsg("Duplicate property name", s, end)) pairs[key] = value end = _w(s, end).end() nextchar = s[end:end + 1] diff --git a/simplejson/tests/test_fail.py b/simplejson/tests/test_fail.py index e205a697dcf757c138188eeeb516c90772b4d89a_c2ltcGxlanNvbi90ZXN0cy90ZXN0X2ZhaWwucHk=..8cda38283e68c17241d4a1f9eca80c4af5be1a17_c2ltcGxlanNvbi90ZXN0cy90ZXN0X2ZhaWwucHk= 100644 --- a/simplejson/tests/test_fail.py +++ b/simplejson/tests/test_fail.py @@ -48,6 +48,8 @@ '["Bad value", truth]', # http://json.org/JSON_checker/test/fail24.json "['single quote']", + # Not part of the JSON spec + '{"a": 1, "a": 1}', ] SKIPS = {