Skip to content

Commit de7e87c

Browse files
Manually insert deprecation warning for sqlite3.connect
1 parent 01c4067 commit de7e87c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Modules/_sqlite/module.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,17 @@ pysqlite_connect(PyObject *module, PyObject *const *args, Py_ssize_t nargsf,
6464

6565
static const int FACTORY_POS = 5;
6666
Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
67+
if (nargs > 1 && nargs <= 8) {
68+
if (PyErr_WarnEx(PyExc_DeprecationWarning,
69+
"Passing more than 1 positional argument to sqlite3.connect()"
70+
" is deprecated. Parameters 'timeout', 'detect_types', "
71+
"'isolation_level', 'check_same_thread', 'factory', "
72+
"'cached_statements' and 'uri' will become keyword-only "
73+
"parameters in Python 3.15.", 1))
74+
{
75+
return NULL;
76+
}
77+
}
6778
if (nargs > FACTORY_POS) {
6879
factory = args[FACTORY_POS];
6980
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy