diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2022-05-21 13:53:58 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-21 13:53:58 (GMT) |
commit | d9a48d2b413194f36111aa54df331d60c5bfde3f (patch) | |
tree | f4b7c27ba630388d7fb964c4249dfc0f1d799878 /Modules | |
parent | f2aeb3f6f782716d6b8fbff336d6258a24ba021c (diff) | |
download | cpython-d9a48d2b413194f36111aa54df331d60c5bfde3f.zip cpython-d9a48d2b413194f36111aa54df331d60c5bfde3f.tar.gz cpython-d9a48d2b413194f36111aa54df331d60c5bfde3f.tar.bz2 |
[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 14c0d33016a967a98155f2e1615660e9328aef5d)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_sqlite/clinic/module.c.h | 6 | ||||
-rw-r--r-- | Modules/_sqlite/module.c | 5 |
2 files changed, 4 insertions, 7 deletions
diff --git a/Modules/_sqlite/clinic/module.c.h b/Modules/_sqlite/clinic/module.c.h index 8f7008a..b088f4b 100644 --- a/Modules/_sqlite/clinic/module.c.h +++ b/Modules/_sqlite/clinic/module.c.h @@ -43,9 +43,7 @@ pysqlite_connect(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb if (!args) { goto exit; } - if (!PyUnicode_FSConverter(args[0], &database)) { - goto exit; - } + database = args[0]; if (!noptargs) { goto skip_optional_pos; } @@ -334,4 +332,4 @@ skip_optional: exit: return return_value; } -/*[clinic end generated code: output=d846459943008a9c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=10c4f942dc9f0c79 input=a9049054013a1b77]*/ diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c index fbc57c7..3f69427 100644 --- a/Modules/_sqlite/module.c +++ b/Modules/_sqlite/module.c @@ -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; } |