changeset: 95917:c91d135b0776 branch: 2.7 parent: 95900:e8783c581928 user: Larry Hastings date: Fri May 08 09:56:29 2015 -0700 files: Misc/NEWS Modules/_sqlite/connection.c description: Issue #20274: When calling a _sqlite.Connection, it now complains if passed any keyword arguments. Previously it silently ignored them. Also: Remove ignored and erroneous "kwargs" parameters from three METH_VARARGS methods on _sqlite.Connection. diff -r e8783c581928 -r c91d135b0776 Misc/NEWS --- a/Misc/NEWS Wed May 06 19:21:00 2015 +0300 +++ b/Misc/NEWS Fri May 08 09:56:29 2015 -0700 @@ -10,6 +10,12 @@ Core and Builtins ----------------- +- Issue #20274: When calling a _sqlite.Connection, it now complains if passed + any keyword arguments. Previously it silently ignored them. + +- Issue #20274: Remove ignored and erroneous "kwargs" parameters from three + METH_VARARGS methods on _sqlite.Connection. + - Issue #23629: Fix the default __sizeof__ implementation for variable-sized objects. diff -r e8783c581928 -r c91d135b0776 Modules/_sqlite/connection.c --- a/Modules/_sqlite/connection.c Wed May 06 19:21:00 2015 +0300 +++ b/Modules/_sqlite/connection.c Fri May 08 09:56:29 2015 -0700 @@ -1192,6 +1192,9 @@ return NULL; } + if (!_PyArg_NoKeywords(MODULE_NAME ".Connection()", kwargs)) + return NULL; + if (!PyArg_ParseTuple(args, "O", &sql)) { return NULL; } @@ -1242,7 +1245,7 @@ return (PyObject*)statement; } -PyObject* pysqlite_connection_execute(pysqlite_Connection* self, PyObject* args, PyObject* kwargs) +PyObject* pysqlite_connection_execute(pysqlite_Connection* self, PyObject* args) { PyObject* cursor = 0; PyObject* result = 0; @@ -1271,7 +1274,7 @@ return cursor; } -PyObject* pysqlite_connection_executemany(pysqlite_Connection* self, PyObject* args, PyObject* kwargs) +PyObject* pysqlite_connection_executemany(pysqlite_Connection* self, PyObject* args) { PyObject* cursor = 0; PyObject* result = 0; @@ -1300,7 +1303,7 @@ return cursor; } -PyObject* pysqlite_connection_executescript(pysqlite_Connection* self, PyObject* args, PyObject* kwargs) +PyObject* pysqlite_connection_executescript(pysqlite_Connection* self, PyObject* args) { PyObject* cursor = 0; PyObject* result = 0;