From 4a90ef03637fdc1bc63ee9be82fbf22cbaa68662 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Sat, 3 Mar 2012 02:35:32 +0100 Subject: =?UTF-8?q?Issue=20#14177:=20marshal.loads()=20now=20raises=20Type?= =?UTF-8?q?Error=20when=20given=20an=20unicode=20string.=20Patch=20by=20Gu?= =?UTF-8?q?ilherme=20Gon=C3=A7alves.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Python/marshal.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Python') diff --git a/Python/marshal.c b/Python/marshal.c index 7b1af44f99..3e2fbeb499 100644 --- a/Python/marshal.c +++ b/Python/marshal.c @@ -1383,7 +1383,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[] = { -- cgit v1.2.1