diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-06-28 23:58:26 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-06-28 23:58:26 (GMT) |
commit | 2d24e94bbef97913b5fc434f991fa429f1533557 (patch) | |
tree | 0423c88ed968018d13bb60d7dc9687f99ab06811 /Modules | |
parent | 24319ac40737a3c305bbadca4f89c607a54ec967 (diff) | |
download | cpython-2d24e94bbef97913b5fc434f991fa429f1533557.zip cpython-2d24e94bbef97913b5fc434f991fa429f1533557.tar.gz cpython-2d24e94bbef97913b5fc434f991fa429f1533557.tar.bz2 |
Issue #5067: improve some json error messages.
Patch by Serhiy Storchaka.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_json.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/_json.c b/Modules/_json.c index 0924873..2a71b9f 100644 --- a/Modules/_json.c +++ b/Modules/_json.c @@ -634,7 +634,7 @@ _parse_object_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ss /* read key */ if (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); @@ -655,7 +655,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(str[idx])) idx++; if (idx > end_idx || str[idx] != ':') { - raise_errmsg("Expecting : delimiter", pystr, idx); + raise_errmsg("Expecting ':' delimiter", pystr, idx); goto bail; } idx++; @@ -695,7 +695,7 @@ _parse_object_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ss break; } else if (str[idx] != ',') { - raise_errmsg("Expecting , delimiter", pystr, idx); + raise_errmsg("Expecting ',' delimiter", pystr, idx); goto bail; } idx++; @@ -777,7 +777,7 @@ _parse_array_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssi break; } else if (str[idx] != ',') { - raise_errmsg("Expecting , delimiter", pystr, idx); + raise_errmsg("Expecting ',' delimiter", pystr, idx); goto bail; } idx++; |