diff --git a/CHANGES.txt b/CHANGES.txt index a8d953018421916a1e4d2be8eb2b1c7c0c62570e_Q0hBTkdFUy50eHQ=..d23ed7f280260c81d01b84eb3aececeeba4a4eb0_Q0hBTkdFUy50eHQ= 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,8 @@ +Version 2.6.1 released 2012-07-27 + +* raw_decode() now skips whitespace before the object + https://github.com/simplejson/simplejson/pull/38 + Version 2.6.0 released 2012-06-26 * Error messages changed to match proposal for Python 3.3.1 diff --git a/conf.py b/conf.py index a8d953018421916a1e4d2be8eb2b1c7c0c62570e_Y29uZi5weQ==..d23ed7f280260c81d01b84eb3aececeeba4a4eb0_Y29uZi5weQ== 100644 --- a/conf.py +++ b/conf.py @@ -44,7 +44,7 @@ # The short X.Y version. version = '2.6' # The full version, including alpha/beta/rc tags. -release = '2.6.0' +release = '2.6.1' # 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 a8d953018421916a1e4d2be8eb2b1c7c0c62570e_aW5kZXgucnN0..d23ed7f280260c81d01b84eb3aececeeba4a4eb0_aW5kZXgucnN0 100644 --- a/index.rst +++ b/index.rst @@ -418,6 +418,6 @@ :exc:`JSONDecodeError` will be raised if the given JSON document is not valid. - .. method:: raw_decode(s) + .. method:: raw_decode(s[, idx=0]) Decode a JSON document from *s* (a :class:`str` or :class:`unicode` @@ -422,6 +422,7 @@ Decode a JSON document from *s* (a :class:`str` or :class:`unicode` - beginning with a JSON document) and return a 2-tuple of the Python - representation and the index in *s* where the document ended. + beginning with a JSON document) starting from the index *idx* and return + a 2-tuple of the Python representation and the index in *s* where the + document ended. This can be used to decode a JSON document from a string that may have @@ -426,6 +427,7 @@ This can be used to decode a JSON document from a string that may have - extraneous data at the end. + extraneous data at the end, or to decode a string that has a series of + JSON objects. :exc:`JSONDecodeError` will be raised if the given JSON document is not valid. diff --git a/setup.py b/setup.py index a8d953018421916a1e4d2be8eb2b1c7c0c62570e_c2V0dXAucHk=..d23ed7f280260c81d01b84eb3aececeeba4a4eb0_c2V0dXAucHk= 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ DistutilsPlatformError IS_PYPY = hasattr(sys, 'pypy_translation_info') -VERSION = '2.6.0' +VERSION = '2.6.1' 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 a8d953018421916a1e4d2be8eb2b1c7c0c62570e_c2ltcGxlanNvbi9fX2luaXRfXy5weQ==..d23ed7f280260c81d01b84eb3aececeeba4a4eb0_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.6.0' +__version__ = '2.6.1' __all__ = [ 'dump', 'dumps', 'load', 'loads', 'JSONDecoder', 'JSONDecodeError', 'JSONEncoder', diff --git a/simplejson/tests/test_decode.py b/simplejson/tests/test_decode.py index a8d953018421916a1e4d2be8eb2b1c7c0c62570e_c2ltcGxlanNvbi90ZXN0cy90ZXN0X2RlY29kZS5weQ==..d23ed7f280260c81d01b84eb3aececeeba4a4eb0_c2ltcGxlanNvbi90ZXN0cy90ZXN0X2RlY29kZS5weQ== 100644 --- a/simplejson/tests/test_decode.py +++ b/simplejson/tests/test_decode.py @@ -81,3 +81,7 @@ self.assertEqual( ({'a': {}}, 9), cls(object_pairs_hook=dict).raw_decode("{\"a\": {}}")) + # https://github.com/simplejson/simplejson/pull/38 + self.assertEqual( + ({'a': {}}, 11), + cls().raw_decode(" \n{\"a\": {}}"))