diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-03-03 01:38:37 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-03-03 01:38:37 (GMT) |
commit | 0d3a003f241460e417f2108fecf990b7ce5d1449 (patch) | |
tree | 8f773e6a59bd4a5244f1025b870d294ccd4eb17e /Python/marshal.c | |
parent | 135b6d8aa5a24b08170fd94114a80dfeb1ae963c (diff) | |
parent | 4a90ef03637fdc1bc63ee9be82fbf22cbaa68662 (diff) | |
download | cpython-0d3a003f241460e417f2108fecf990b7ce5d1449.zip cpython-0d3a003f241460e417f2108fecf990b7ce5d1449.tar.gz cpython-0d3a003f241460e417f2108fecf990b7ce5d1449.tar.bz2 |
- Issue #14177: marshal.loads() now raises TypeError when given an unicode
string. Patch by Guilherme Gonçalves.
Diffstat (limited to 'Python/marshal.c')
-rw-r--r-- | Python/marshal.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/marshal.c b/Python/marshal.c index 77824d4..b94e8d8 100644 --- a/Python/marshal.c +++ b/Python/marshal.c @@ -1384,7 +1384,7 @@ marshal_loads(PyObject *self, PyObject *args) char *s; Py_ssize_t n; PyObject* result; - if (!PyArg_ParseTuple(args, "s*:loads", &p)) + if (!PyArg_ParseTuple(args, "y*:loads", &p)) return NULL; s = p.buf; n = p.len; @@ -1400,10 +1400,10 @@ marshal_loads(PyObject *self, PyObject *args) } PyDoc_STRVAR(loads_doc, -"loads(string)\n\ +"loads(bytes)\n\ \n\ -Convert the string to a value. If no valid value is found, raise\n\ -EOFError, ValueError or TypeError. Extra characters in the string are\n\ +Convert the bytes object to a value. If no valid value is found, raise\n\ +EOFError, ValueError or TypeError. Extra characters in the input are\n\ ignored."); static PyMethodDef marshal_methods[] = { |