Skip to content

Commit

Permalink
bump version to 2.6.1 and add test/docs for #38 raw_decode fix
Browse files Browse the repository at this point in the history
  • Loading branch information
etrepum committed Jul 28, 2012
1 parent 5178cb7 commit 6f5ca6b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 6 additions & 4 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion simplejson/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 4 additions & 0 deletions simplejson/tests/test_decode.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,7 @@ def test_raw_decode(self):
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\": {}}"))

0 comments on commit 6f5ca6b

Please sign in to comment.