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 fe16b3c..e76f187 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -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 --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index 0ed196d..79a7a00 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -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;