mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
[3.11] gh-93044: No longer convert the database argument of sqlite3.connect() to bytes (GH-93046) (GH-93048)
Just pass it to the factory as is.
(cherry picked from commit 14c0d33016
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
f2aeb3f6f7
commit
d9a48d2b41
4 changed files with 19 additions and 7 deletions
|
@ -46,7 +46,7 @@ module _sqlite3
|
|||
/*[clinic input]
|
||||
_sqlite3.connect as pysqlite_connect
|
||||
|
||||
database: object(converter='PyUnicode_FSConverter')
|
||||
database: object
|
||||
timeout: double = 5.0
|
||||
detect_types: int = 0
|
||||
isolation_level: object = NULL
|
||||
|
@ -66,7 +66,7 @@ pysqlite_connect_impl(PyObject *module, PyObject *database, double timeout,
|
|||
int detect_types, PyObject *isolation_level,
|
||||
int check_same_thread, PyObject *factory,
|
||||
int cached_statements, int uri)
|
||||
/*[clinic end generated code: output=450ac9078b4868bb input=ea6355ba55a78e12]*/
|
||||
/*[clinic end generated code: output=450ac9078b4868bb input=e16914663ddf93ce]*/
|
||||
{
|
||||
if (isolation_level == NULL) {
|
||||
isolation_level = PyUnicode_FromString("");
|
||||
|
@ -81,7 +81,6 @@ pysqlite_connect_impl(PyObject *module, PyObject *database, double timeout,
|
|||
timeout, detect_types,
|
||||
isolation_level, check_same_thread,
|
||||
factory, cached_statements, uri);
|
||||
Py_DECREF(database); // needed bco. the AC FSConverter
|
||||
Py_DECREF(isolation_level);
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue