summaryrefslogtreecommitdiffstats
path: root/Lib/json/decoder.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-02-21 18:19:16 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-02-21 18:19:16 (GMT)
commitc510a048ba4f17a82fff0a452bf9ccd29b51efc6 (patch)
tree5162cdafe017c4fde80b90e05adc5b4ddb295268 /Lib/json/decoder.py
parenta2964b3175b8faba0285ccfbd269411a4893444d (diff)
downloadcpython-c510a048ba4f17a82fff0a452bf9ccd29b51efc6.zip
cpython-c510a048ba4f17a82fff0a452bf9ccd29b51efc6.tar.gz
cpython-c510a048ba4f17a82fff0a452bf9ccd29b51efc6.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 dc1155b..0c59edd 100644
--- a/Lib/json/decoder.py
+++ b/Lib/json/decoder.py
@@ -32,7 +32,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