(original) (raw)
changeset: 95916:3e9f4f3c7fa7 parent: 95914:a3ee6990daea parent: 95915:4c860369b6c2 user: Larry Hastings larry@hastings.org date: Fri May 08 07:45:10 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: merge related change from 3.4, also reported on Issue #20274. diff -r a3ee6990daea -r 3e9f4f3c7fa7 Misc/NEWS --- a/Misc/NEWS Fri May 08 06:58:56 2015 -0700 +++ b/Misc/NEWS Fri May 08 07:45:10 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 #2292: PEP 448: Additional Unpacking Generalizations. - Issue #24096: Make warnings.warn_explicit more robust against mutation of the diff -r a3ee6990daea -r 3e9f4f3c7fa7 Modules/_sqlite/connection.c --- a/Modules/_sqlite/connection.c Fri May 08 06:58:56 2015 -0700 +++ b/Modules/_sqlite/connection.c Fri May 08 07:45:10 2015 -0700 @@ -1241,6 +1241,9 @@ return NULL; } + if (!_PyArg_NoKeywords(MODULE_NAME ".Connection()", kwargs)) + return NULL; + if (!PyArg_ParseTuple(args, "O", &sql)) return NULL; @@ -1287,7 +1290,7 @@ return NULL; } -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; @@ -1316,7 +1319,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; @@ -1345,7 +1348,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; /larry@hastings.org