Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
49d4022d
Commit
49d4022d
authored
Feb 21, 2013
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #17225: JSON decoder now counts columns in the first line starting
with 1, as in other lines.
parent
484dee38
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
4 deletions
+7
-4
Doc/library/json.rst
Doc/library/json.rst
+1
-1
Lib/json/__init__.py
Lib/json/__init__.py
+1
-1
Lib/json/decoder.py
Lib/json/decoder.py
+1
-1
Lib/json/tool.py
Lib/json/tool.py
+1
-1
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Doc/library/json.rst
View file @
49d4022d
...
...
@@ -103,7 +103,7 @@ Using json.tool from the shell to validate and pretty-print::
"json": "obj"
}
$ echo '{1.2:3.4}' | python -mjson.tool
Expecting property name enclosed in double quotes: line 1 column
1
(char 1)
Expecting property name enclosed in double quotes: line 1 column
2
(char 1)
.. highlight:: python
...
...
Lib/json/__init__.py
View file @
49d4022d
...
...
@@ -95,7 +95,7 @@ Using json.tool from the shell to validate and pretty-print::
"json": "obj"
}
$ echo '{ 1.2:3.4}' | python -m json.tool
Expecting property name enclosed in double quotes: line 1 column
2
(char 2)
Expecting property name enclosed in double quotes: line 1 column
3
(char 2)
"""
__version__
=
'2.0.9'
__all__
=
[
...
...
Lib/json/decoder.py
View file @
49d4022d
...
...
@@ -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
...
...
Lib/json/tool.py
View file @
49d4022d
...
...
@@ -7,7 +7,7 @@ Usage::
"json": "obj"
}
$ echo '{ 1.2:3.4}' | python -m json.tool
Expecting property name enclosed in double quotes: line 1 column
2
(char 2)
Expecting property name enclosed in double quotes: line 1 column
3
(char 2)
"""
import
sys
...
...
Misc/NEWS
View file @
49d4022d
...
...
@@ -208,6 +208,9 @@ Core and Builtins
Library
-------
- Issue #17225: JSON decoder now counts columns in the first line starting
with 1, as in other lines.
- Issue #7842: backported fix for py_compile.compile() syntax error handling.
- Issue #13153: Tkinter functions now raise TclError instead of ValueError when
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment