diff --git a/CHANGES.txt b/CHANGES.txt index 42e9f52a7e6345a19574ac2778273eeedeacd8eb_Q0hBTkdFUy50eHQ=..08df7633a87bc3079ba438dfaf5e6eeae2a56048_Q0hBTkdFUy50eHQ= 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,9 @@ +Version 3.0.9 released 2013-02-21 + +* Fix an off-by-one error in the colno property of JSONDecodeError + (when lineno == 1) + http://bugs.python.org/issue17225 + Version 3.0.8 released 2013-02-19 * Fix a Python 2.x compiler warning for narrow unicode builds diff --git a/conf.py b/conf.py index 42e9f52a7e6345a19574ac2778273eeedeacd8eb_Y29uZi5weQ==..08df7633a87bc3079ba438dfaf5e6eeae2a56048_Y29uZi5weQ== 100644 --- a/conf.py +++ b/conf.py @@ -44,7 +44,7 @@ # The short X.Y version. version = '3.0' # The full version, including alpha/beta/rc tags. -release = '3.0.8' +release = '3.0.9' # 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 42e9f52a7e6345a19574ac2778273eeedeacd8eb_aW5kZXgucnN0..08df7633a87bc3079ba438dfaf5e6eeae2a56048_aW5kZXgucnN0 100644 --- a/index.rst +++ b/index.rst @@ -117,7 +117,7 @@ "json": "obj" } $ echo '{ 1.2:3.4}' | python -m simplejson.tool - Expecting property name enclosed in double quotes: line 1 column 2 (char 2) + Expecting property name enclosed in double quotes: line 1 column 3 (char 2) .. highlight:: python diff --git a/setup.py b/setup.py index 42e9f52a7e6345a19574ac2778273eeedeacd8eb_c2V0dXAucHk=..08df7633a87bc3079ba438dfaf5e6eeae2a56048_c2V0dXAucHk= 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ DistutilsPlatformError IS_PYPY = hasattr(sys, 'pypy_translation_info') -VERSION = '3.0.8' +VERSION = '3.0.9' DESCRIPTION = "Simple, fast, extensible JSON encoder/decoder for Python" with open('README.rst', 'r') as f: diff --git a/simplejson/__init__.py b/simplejson/__init__.py index 42e9f52a7e6345a19574ac2778273eeedeacd8eb_c2ltcGxlanNvbi9fX2luaXRfXy5weQ==..08df7633a87bc3079ba438dfaf5e6eeae2a56048_c2ltcGxlanNvbi9fX2luaXRfXy5weQ== 100644 --- a/simplejson/__init__.py +++ b/simplejson/__init__.py @@ -96,6 +96,6 @@ "json": "obj" } $ echo '{ 1.2:3.4}' | python -m simplejson.tool - Expecting property name: line 1 column 2 (char 2) + Expecting property name: line 1 column 3 (char 2) """ from __future__ import absolute_import @@ -100,6 +100,6 @@ """ from __future__ import absolute_import -__version__ = '3.0.8' +__version__ = '3.0.9' __all__ = [ 'dump', 'dumps', 'load', 'loads', 'JSONDecoder', 'JSONDecodeError', 'JSONEncoder', diff --git a/simplejson/decoder.py b/simplejson/decoder.py index 42e9f52a7e6345a19574ac2778273eeedeacd8eb_c2ltcGxlanNvbi9kZWNvZGVyLnB5..08df7633a87bc3079ba438dfaf5e6eeae2a56048_c2ltcGxlanNvbi9kZWNvZGVyLnB5 100644 --- a/simplejson/decoder.py +++ b/simplejson/decoder.py @@ -59,7 +59,7 @@ def linecol(doc, pos): lineno = doc.count('\n', 0, pos) + 1 if lineno == 1: - colno = pos + colno = pos + 1 else: colno = pos - doc.rindex('\n', 0, pos) return lineno, colno diff --git a/simplejson/tests/test_errors.py b/simplejson/tests/test_errors.py index 42e9f52a7e6345a19574ac2778273eeedeacd8eb_c2ltcGxlanNvbi90ZXN0cy90ZXN0X2Vycm9ycy5weQ==..08df7633a87bc3079ba438dfaf5e6eeae2a56048_c2ltcGxlanNvbi90ZXN0cy90ZXN0X2Vycm9ycy5weQ== 100644 --- a/simplejson/tests/test_errors.py +++ b/simplejson/tests/test_errors.py @@ -32,4 +32,4 @@ else: self.fail('Expected JSONDecodeError') self.assertEqual(err.lineno, 1) - self.assertEqual(err.colno, 9) + self.assertEqual(err.colno, 10) diff --git a/simplejson/tests/test_fail.py b/simplejson/tests/test_fail.py index 42e9f52a7e6345a19574ac2778273eeedeacd8eb_c2ltcGxlanNvbi90ZXN0cy90ZXN0X2ZhaWwucHk=..08df7633a87bc3079ba438dfaf5e6eeae2a56048_c2ltcGxlanNvbi90ZXN0cy90ZXN0X2ZhaWwucHk= 100644 --- a/simplejson/tests/test_fail.py +++ b/simplejson/tests/test_fail.py @@ -111,7 +111,7 @@ e = sys.exc_info()[1] self.assertEqual(e.pos, 1) self.assertEqual(e.lineno, 1) - self.assertEqual(e.colno, 1) + self.assertEqual(e.colno, 2) except Exception: e = sys.exc_info()[1] self.fail("Unexpected exception raised %r %s" % (e, e))