mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
gh-93057: Deprecate positional use of optional sqlite3.connect() params (#107948)
This commit is contained in:
parent
a482e5bf00
commit
13c36dc9ae
9 changed files with 92 additions and 5 deletions
|
@ -64,6 +64,17 @@ pysqlite_connect(PyObject *module, PyObject *const *args, Py_ssize_t nargsf,
|
|||
|
||||
static const int FACTORY_POS = 5;
|
||||
Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
|
||||
if (nargs > 1 && nargs <= 8) {
|
||||
if (PyErr_WarnEx(PyExc_DeprecationWarning,
|
||||
"Passing more than 1 positional argument to sqlite3.connect()"
|
||||
" is deprecated. Parameters 'timeout', 'detect_types', "
|
||||
"'isolation_level', 'check_same_thread', 'factory', "
|
||||
"'cached_statements' and 'uri' will become keyword-only "
|
||||
"parameters in Python 3.15.", 1))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (nargs > FACTORY_POS) {
|
||||
factory = args[FACTORY_POS];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue