diff options
author | Erlend E. Aasland <erlend@python.org> | 2023-08-15 10:09:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-15 08:09:56 +0000 |
commit | 13c36dc9ae5240124932137de4a94d81292c6c5f (patch) | |
tree | d0c519b57139c9af90bec3f6df794d37fdaf94b1 /Modules/_sqlite/module.c | |
parent | a482e5bf0022f85424a6308529a9ad51f1bfbb71 (diff) | |
download | cpython-13c36dc9ae5240124932137de4a94d81292c6c5f.tar.gz cpython-13c36dc9ae5240124932137de4a94d81292c6c5f.zip |
gh-93057: Deprecate positional use of optional sqlite3.connect() params (#107948)
Diffstat (limited to 'Modules/_sqlite/module.c')
-rw-r--r-- | Modules/_sqlite/module.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c index 0c503dfbebb..dd45ffc1988 100644 --- a/Modules/_sqlite/module.c +++ b/Modules/_sqlite/module.c @@ -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]; } |