summaryrefslogtreecommitdiffstats
path: root/Lib/json/decoder.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-02-21 18:26:52 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-02-21 18:26:52 (GMT)
commit920007ad76f1a880e6784ddb97a5c6c99a19b9a9 (patch)
treee2357a83bd8c806e9cd1383d0696a0c2c02e2bfc /Lib/json/decoder.py
parentfc9bf110a21cd62ffebf36df743777e6d6097cb6 (diff)
parented891c151748d030a890d50f3bbce3f581304439 (diff)
downloadcpython-920007ad76f1a880e6784ddb97a5c6c99a19b9a9.zip
cpython-920007ad76f1a880e6784ddb97a5c6c99a19b9a9.tar.gz
cpython-920007ad76f1a880e6784ddb97a5c6c99a19b9a9.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 7e5a099..1b6c10b 100644
--- a/Lib/json/decoder.py
+++ b/Lib/json/decoder.py
@@ -24,7 +24,7 @@ def linecol(doc, pos):
newline = '\n'
lineno = doc.count(newline, 0, pos) + 1
if lineno == 1:
- colno = pos
+ colno = pos + 1
else:
colno = pos - doc.rindex(newline, 0, pos)
return lineno, colno