diff options
author | Bob Ippolito <bob@redivi.com> | 2012-07-27 21:59:46 -0700 |
---|---|---|
committer | Bob Ippolito <bob@redivi.com> | 2012-07-27 21:59:46 -0700 |
commit | 6f5ca6ba4d2f71958176756eac2ac7fe6ec62537 (patch) | |
tree | 52a68a2b4bdda7227c8586b8e948eaa2991e7ed7 | |
parent | 5178cb760e35a8a921fd509f7d5da383d122d54e (diff) | |
download | simplejson-6f5ca6ba4d2f71958176756eac2ac7fe6ec62537.tar.gz |
bump version to 2.6.1 and add test/docs for #38 raw_decode fixv2.6.1
-rw-r--r-- | CHANGES.txt | 5 | ||||
-rw-r--r-- | conf.py | 2 | ||||
-rw-r--r-- | index.rst | 10 | ||||
-rw-r--r-- | setup.py | 2 | ||||
-rw-r--r-- | simplejson/__init__.py | 2 | ||||
-rw-r--r-- | simplejson/tests/test_decode.py | 4 |
6 files changed, 18 insertions, 7 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 10cb5b9..598e216 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 @@ -44,7 +44,7 @@ copyright = '2012, Bob Ippolito' # 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: @@ -418,14 +418,16 @@ Encoders and decoders :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` - 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 - 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. @@ -7,7 +7,7 @@ from distutils.errors import CCompilerError, DistutilsExecError, \ 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 04a8aa6..dcf072d 100644 --- a/simplejson/__init__.py +++ b/simplejson/__init__.py @@ -97,7 +97,7 @@ Using simplejson.tool from the shell to validate and pretty-print:: $ 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 a140a13..37b231b 100644 --- a/simplejson/tests/test_decode.py +++ b/simplejson/tests/test_decode.py @@ -81,3 +81,7 @@ class TestDecode(TestCase): 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\": {}}")) |