From: Larry Hastings Date: Fri, 8 May 2015 16:56:29 +0000 (-0700) Subject: Issue #20274: When calling a _sqlite.Connection, it now complains if passed X-Git-Tag: v2.7.10rc1~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=101b054c32a54acd5d1c84b03ebc71cac51b3e3b;p=thirdparty%2FPython%2Fcpython.git 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 --git a/Misc/NEWS b/Misc/NEWS index fe16b3c789b6..e76f18710c31 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,12 @@ What's New in Python 2.7.10? 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 --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c index 0ed196d0e39e..79a7a0013c0f 100644 --- a/Modules/_sqlite/connection.c +++ b/Modules/_sqlite/connection.c @@ -1192,6 +1192,9 @@ PyObject* pysqlite_connection_call(pysqlite_Connection* self, PyObject* args, Py return NULL; } + if (!_PyArg_NoKeywords(MODULE_NAME ".Connection()", kwargs)) + return NULL; + if (!PyArg_ParseTuple(args, "O", &sql)) { return NULL; } @@ -1242,7 +1245,7 @@ error: 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 @@ error: 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 @@ error: 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;