Message182320
The linecol() function in json/decoder.py computes the line and column numbers for a byte offset in a string. Both numbers are expected to start with 1 (as in text editors).
If the position is in the first line, the returned column is off by one (or starting with zero):
>>> from json.decoder import linecol
>>> linecol('spam', 0) # Should be (1, 1)
(1, 0)
>>> linecol('\nspam', 1)
(2, 1)
The problem is the line:
if lineno == 1:
colno = pos
that should read
if lineno == 1:
colno = pos + 1 |
|
Date |
User |
Action |
Args |
2013-02-18 13:19:26 | fbeyer | set | recipients:
+ fbeyer |
2013-02-18 13:19:26 | fbeyer | set | messageid: <1361193566.84.0.658685915007.issue17225@psf.upfronthosting.co.za> |
2013-02-18 13:19:26 | fbeyer | link | issue17225 messages |
2013-02-18 13:19:26 | fbeyer | create | |
|