summaryrefslogtreecommitdiffstats
path: root/Modules/_io
diff options
context:
space:
mode:
authorAlexandre Vassalotti <alexandre@peadrop.com>2009-08-04 23:19:13 (GMT)
committerAlexandre Vassalotti <alexandre@peadrop.com>2009-08-04 23:19:13 (GMT)
commitba5c74329dadfb685bb921407916ffbb2efb78cc (patch)
tree87cb09d927b70eda261d80b064285dc3b0aec752 /Modules/_io
parentbbffb25c69f748a8842bb16718d79b86ad16b867 (diff)
downloadcpython-ba5c74329dadfb685bb921407916ffbb2efb78cc.zip
cpython-ba5c74329dadfb685bb921407916ffbb2efb78cc.tar.gz
cpython-ba5c74329dadfb685bb921407916ffbb2efb78cc.tar.bz2
Issue 5449: Fix io.BytesIO to not accept arbitrary keywords
Patch contributed by Erick Tryzelaar.
Diffstat (limited to 'Modules/_io')
-rw-r--r--Modules/_io/bytesio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c
index 7b56551..5ca878d 100644
--- a/Modules/_io/bytesio.c
+++ b/Modules/_io/bytesio.c
@@ -759,9 +759,11 @@ bytesio_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
static int
bytesio_init(bytesio *self, PyObject *args, PyObject *kwds)
{
+ char *kwlist[] = {"initial_bytes", NULL};
PyObject *initvalue = NULL;
- if (!PyArg_ParseTuple(args, "|O:BytesIO", &initvalue))
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O:BytesIO", kwlist,
+ &initvalue))
return -1;
/* In case, __init__ is called multiple times. */