summaryrefslogtreecommitdiffstats
path: root/Modules/_json.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-06-28 23:59:54 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-06-28 23:59:54 (GMT)
commit802d669044b14ae535e0136c6a9949a1725b7e14 (patch)
tree79dd128aa2e8a63906eac4a1e254cb5019949a89 /Modules/_json.c
parent3a3dc17fc9a934682dda76188b367ec261905520 (diff)
parent2d24e94bbef97913b5fc434f991fa429f1533557 (diff)
downloadcpython-802d669044b14ae535e0136c6a9949a1725b7e14.zip
cpython-802d669044b14ae535e0136c6a9949a1725b7e14.tar.gz
cpython-802d669044b14ae535e0136c6a9949a1725b7e14.tar.bz2
Issue #5067: improve some json error messages.
Patch by Serhiy Storchaka.
Diffstat (limited to 'Modules/_json.c')
-rw-r--r--Modules/_json.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/_json.c b/Modules/_json.c
index 40c2ced..fb8bd59 100644
--- a/Modules/_json.c
+++ b/Modules/_json.c
@@ -646,7 +646,7 @@ _parse_object_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ss
/* read key */
if (PyUnicode_READ(kind, str, idx) != '"') {
- raise_errmsg("Expecting property name", pystr, idx);
+ raise_errmsg("Expecting property name enclosed in double quotes", pystr, idx);
goto bail;
}
key = scanstring_unicode(pystr, idx + 1, strict, &next_idx);
@@ -667,7 +667,7 @@ _parse_object_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ss
/* skip whitespace between key and : delimiter, read :, skip whitespace */
while (idx <= end_idx && IS_WHITESPACE(PyUnicode_READ(kind, str, idx))) idx++;
if (idx > end_idx || PyUnicode_READ(kind, str, idx) != ':') {
- raise_errmsg("Expecting : delimiter", pystr, idx);
+ raise_errmsg("Expecting ':' delimiter", pystr, idx);
goto bail;
}
idx++;
@@ -707,7 +707,7 @@ _parse_object_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ss
break;
}
else if (PyUnicode_READ(kind, str, idx) != ',') {
- raise_errmsg("Expecting , delimiter", pystr, idx);
+ raise_errmsg("Expecting ',' delimiter", pystr, idx);
goto bail;
}
idx++;
@@ -797,7 +797,7 @@ _parse_array_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssi
break;
}
else if (PyUnicode_READ(kind, str, idx) != ',') {
- raise_errmsg("Expecting , delimiter", pystr, idx);
+ raise_errmsg("Expecting ',' delimiter", pystr, idx);
goto bail;
}
idx++;