commit | 49d4022d7d56a027a8be0fc96f58d183bfbc2291 | [log] [tgz] |
---|---|---|
author | Serhiy Storchaka <storchaka@gmail.com> | Thu Feb 21 20:17:54 2013 +0200 |
committer | Serhiy Storchaka <storchaka@gmail.com> | Thu Feb 21 20:17:54 2013 +0200 |
tree | 54e47fc16eb2990f9c23b06e16e4473d09091beb | |
parent | 484dee38e665e20f961b18f27a82b3224341c1be [diff] [blame] |
Issue #17225: JSON decoder now counts columns in the first line starting with 1, as in other lines.
diff --git a/Lib/json/decoder.py b/Lib/json/decoder.py index 7e2c68c..dc8916c 100644 --- a/Lib/json/decoder.py +++ b/Lib/json/decoder.py
@@ -27,7 +27,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