mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Issue 5449: Fix io.BytesIO to not accept arbitrary keywords
Patch contributed by Erick Tryzelaar.
This commit is contained in:
parent
bbffb25c69
commit
ba5c74329d
2 changed files with 8 additions and 1 deletions
|
@ -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. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue