summaryrefslogtreecommitdiffstats
path: root/Lib/json/decoder.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-02-21 18:17:54 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-02-21 18:17:54 (GMT)
commit49d4022d7d56a027a8be0fc96f58d183bfbc2291 (patch)
tree54e47fc16eb2990f9c23b06e16e4473d09091beb /Lib/json/decoder.py
parent484dee38e665e20f961b18f27a82b3224341c1be (diff)
downloadcpython-49d4022d7d56a027a8be0fc96f58d183bfbc2291.zip
cpython-49d4022d7d56a027a8be0fc96f58d183bfbc2291.tar.gz
cpython-49d4022d7d56a027a8be0fc96f58d183bfbc2291.tar.bz2
Issue #17225: JSON decoder now counts columns in the first line starting
with 1, as in other lines.
Diffstat (limited to 'Lib/json/decoder.py')
-rw-r--r--Lib/json/decoder.py2
1 files changed, 1 insertions, 1 deletions
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 @@ NaN, PosInf, NegInf = _floatconstants()
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