]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #20274: When calling a _sqlite.Connection, it now complains if passed
authorLarry Hastings <larry@hastings.org>
Fri, 8 May 2015 16:56:29 +0000 (09:56 -0700)
committerLarry Hastings <larry@hastings.org>
Fri, 8 May 2015 16:56:29 +0000 (09:56 -0700)
any keyword arguments.  Previously it silently ignored them.  Also: Remove
ignored and erroneous "kwargs" parameters from three METH_VARARGS methods
on _sqlite.Connection.

Misc/NEWS
Modules/_sqlite/connection.c

index fe16b3c789b6d7ebebcd1f9ee0dd384f9ef873ad..e76f18710c31e0fdaf6699da349cd13e75afe19a 100644 (file)
--- 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.
 
index 0ed196d0e39e034edc62b3fb835d0078c4d62928..79a7a0013c0f8fc526efafc2b5995210d60193dc 100644 (file)
@@ -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;