diff --git a/CHANGES.txt b/CHANGES.txt index f15d6b193de356f2c9a6584eda584d6f1af11aec_Q0hBTkdFUy50eHQ=..08160213a728a413bdaeba67440538a93dac3fa7_Q0hBTkdFUy50eHQ= 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,8 @@ +Version 2.6.0 released 2012-06-26 + +* Error messages changed to match proposal for Python 3.3.1 + http://bugs.python.org/issue5067 + Version 2.5.2 released 2012-05-10 * Fix for regression introduced in 2.5.1 diff --git a/conf.py b/conf.py index f15d6b193de356f2c9a6584eda584d6f1af11aec_Y29uZi5weQ==..08160213a728a413bdaeba67440538a93dac3fa7_Y29uZi5weQ== 100644 --- a/conf.py +++ b/conf.py @@ -36,9 +36,9 @@ # General substitutions. project = 'simplejson' -copyright = '2011, Bob Ippolito' +copyright = '2012, Bob Ippolito' # The default replacements for |version| and |release|, also used in various # other places throughout the built documents. # # The short X.Y version. @@ -40,7 +40,7 @@ # The default replacements for |version| and |release|, also used in various # other places throughout the built documents. # # The short X.Y version. -version = '2.5' +version = '2.6' # The full version, including alpha/beta/rc tags. @@ -46,5 +46,5 @@ # The full version, including alpha/beta/rc tags. -release = '2.5.2' +release = '2.6.0' # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: diff --git a/index.rst b/index.rst index f15d6b193de356f2c9a6584eda584d6f1af11aec_aW5kZXgucnN0..08160213a728a413bdaeba67440538a93dac3fa7_aW5kZXgucnN0 100644 --- a/index.rst +++ b/index.rst @@ -41,7 +41,7 @@ Compact encoding:: >>> import simplejson as json - >>> json.dumps([1,2,3,{'4': 5, '6': 7}], separators=(',',':')) + >>> json.dumps([1,2,3,{'4': 5, '6': 7}], separators=(',', ':')) '[1,2,3,{"4":5,"6":7}]' Pretty printing:: @@ -116,7 +116,7 @@ "json": "obj" } $ echo '{ 1.2:3.4}' | python -m simplejson.tool - Expecting property name: line 1 column 2 (char 2) + Expecting property name enclosed in double quotes: line 1 column 2 (char 2) .. highlight:: python diff --git a/setup.py b/setup.py index f15d6b193de356f2c9a6584eda584d6f1af11aec_c2V0dXAucHk=..08160213a728a413bdaeba67440538a93dac3fa7_c2V0dXAucHk= 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ DistutilsPlatformError IS_PYPY = hasattr(sys, 'pypy_translation_info') -VERSION = '2.5.2' +VERSION = '2.6.0' DESCRIPTION = "Simple, fast, extensible JSON encoder/decoder for Python" LONG_DESCRIPTION = open('README.rst', 'r').read() diff --git a/simplejson/__init__.py b/simplejson/__init__.py index f15d6b193de356f2c9a6584eda584d6f1af11aec_c2ltcGxlanNvbi9fX2luaXRfXy5weQ==..08160213a728a413bdaeba67440538a93dac3fa7_c2ltcGxlanNvbi9fX2luaXRfXy5weQ== 100644 --- a/simplejson/__init__.py +++ b/simplejson/__init__.py @@ -97,7 +97,7 @@ $ echo '{ 1.2:3.4}' | python -m simplejson.tool Expecting property name: line 1 column 2 (char 2) """ -__version__ = '2.5.2' +__version__ = '2.6.0' __all__ = [ 'dump', 'dumps', 'load', 'loads', 'JSONDecoder', 'JSONDecodeError', 'JSONEncoder', diff --git a/simplejson/_speedups.c b/simplejson/_speedups.c index f15d6b193de356f2c9a6584eda584d6f1af11aec_c2ltcGxlanNvbi9fc3BlZWR1cHMuYw==..08160213a728a413bdaeba67440538a93dac3fa7_c2ltcGxlanNvbi9fc3BlZWR1cHMuYw== 100644 --- a/simplejson/_speedups.c +++ b/simplejson/_speedups.c @@ -1058,7 +1058,9 @@ /* read key */ if (str[idx] != '"') { - raise_errmsg("Expecting property name", pystr, idx); + raise_errmsg( + "Expecting property name enclosed in double quotes", + pystr, idx); goto bail; } key = scanstring_str(pystr, idx + 1, encoding, strict, &next_idx); @@ -1079,7 +1081,7 @@ /* skip whitespace between key and : delimiter, read :, skip whitespace */ while (idx <= end_idx && IS_WHITESPACE(str[idx])) idx++; if (idx > end_idx || str[idx] != ':') { - raise_errmsg("Expecting : delimiter", pystr, idx); + raise_errmsg("Expecting ':' delimiter", pystr, idx); goto bail; } idx++; @@ -1119,7 +1121,7 @@ break; } else if (str[idx] != ',') { - raise_errmsg("Expecting , delimiter", pystr, idx); + raise_errmsg("Expecting ',' delimiter", pystr, idx); goto bail; } idx++; @@ -1204,7 +1206,9 @@ /* read key */ if (str[idx] != '"') { - raise_errmsg("Expecting property name", pystr, idx); + raise_errmsg( + "Expecting property name enclosed in double quotes", + pystr, idx); goto bail; } key = scanstring_unicode(pystr, idx + 1, strict, &next_idx); @@ -1222,6 +1226,7 @@ } idx = next_idx; - /* skip whitespace between key and : delimiter, read :, skip whitespace */ + /* skip whitespace between key and : delimiter, read :, skip + whitespace */ while (idx <= end_idx && IS_WHITESPACE(str[idx])) idx++; if (idx > end_idx || str[idx] != ':') { @@ -1226,6 +1231,6 @@ while (idx <= end_idx && IS_WHITESPACE(str[idx])) idx++; if (idx > end_idx || str[idx] != ':') { - raise_errmsg("Expecting : delimiter", pystr, idx); + raise_errmsg("Expecting ':' delimiter", pystr, idx); goto bail; } idx++; @@ -1259,9 +1264,10 @@ /* skip whitespace before } or , */ while (idx <= end_idx && IS_WHITESPACE(str[idx])) idx++; - /* bail if the object is closed or we didn't get the , delimiter */ + /* bail if the object is closed or we didn't get the , + delimiter */ if (idx > end_idx) break; if (str[idx] == '}') { break; } else if (str[idx] != ',') { @@ -1263,9 +1269,9 @@ if (idx > end_idx) break; if (str[idx] == '}') { break; } else if (str[idx] != ',') { - raise_errmsg("Expecting , delimiter", pystr, idx); + raise_errmsg("Expecting ',' delimiter", pystr, idx); goto bail; } idx++; @@ -1359,7 +1365,7 @@ break; } else if (str[idx] != ',') { - raise_errmsg("Expecting , delimiter", pystr, idx); + raise_errmsg("Expecting ',' delimiter", pystr, idx); goto bail; } idx++; @@ -1431,7 +1437,7 @@ break; } else if (str[idx] != ',') { - raise_errmsg("Expecting , delimiter", pystr, idx); + raise_errmsg("Expecting ',' delimiter", pystr, idx); goto bail; } idx++; diff --git a/simplejson/decoder.py b/simplejson/decoder.py index f15d6b193de356f2c9a6584eda584d6f1af11aec_c2ltcGxlanNvbi9kZWNvZGVyLnB5..08160213a728a413bdaeba67440538a93dac3fa7_c2ltcGxlanNvbi9kZWNvZGVyLnB5 100644 --- a/simplejson/decoder.py +++ b/simplejson/decoder.py @@ -203,7 +203,9 @@ pairs = object_hook(pairs) return pairs, end + 1 elif nextchar != '"': - raise JSONDecodeError("Expecting property name", s, end) + raise JSONDecodeError( + "Expecting property name enclosed in double quotes", + s, end) end += 1 while True: key, end = scanstring(s, end, encoding, strict) @@ -214,7 +216,7 @@ if s[end:end + 1] != ':': end = _w(s, end).end() if s[end:end + 1] != ':': - raise JSONDecodeError("Expecting : delimiter", s, end) + raise JSONDecodeError("Expecting ':' delimiter", s, end) end += 1 @@ -244,7 +246,7 @@ if nextchar == '}': break elif nextchar != ',': - raise JSONDecodeError("Expecting , delimiter", s, end - 1) + raise JSONDecodeError("Expecting ',' delimiter", s, end - 1) try: nextchar = s[end] @@ -259,7 +261,9 @@ end += 1 if nextchar != '"': - raise JSONDecodeError("Expecting property name", s, end - 1) + raise JSONDecodeError( + "Expecting property name enclosed in double quotes", + s, end - 1) if object_pairs_hook is not None: result = object_pairs_hook(pairs) @@ -293,7 +297,7 @@ if nextchar == ']': break elif nextchar != ',': - raise JSONDecodeError("Expecting , delimiter", s, end) + raise JSONDecodeError("Expecting ',' delimiter", s, end) try: if s[end] in _ws: