8000 gh-91922: Fix sqlite connection on nonstardard locales and paths by serhiy-storchaka · Pull Request #92926 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-91922: Fix sqlite connection on nonstardard locales and paths #92926

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Prev Previous commit
Next Next commit
Revert changes in Modules/_sqlite/module.c
  • Loading branch information
serhiy-storchaka committed May 20, 2022
commit 9ba5bd1a97bb669fb4e4867ca36d90f170602867
6 changes: 4 additions & 2 deletions Modules/_sqlite/clinic/module.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Modules/_sqlite/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ module _sqlite3
/*[clinic input]
_sqlite3.connect as pysqlite_connect

database: object
database: object(converter='PyUnicode_FSConverter')
timeout: double = 5.0
detect_types: int = 0
isolation_level: object = NULL
Expand All @@ -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=e16914663ddf93ce]*/
/*[clinic end generated code: output=450ac9078b4868bb input=ea6355ba55a78e12]*/
{
if (isolation_level == NULL) {
isolation_level = PyUnicode_FromString("");
Expand All @@ -77,11 +77,11 @@ pysqlite_connect_impl(PyObject *module, PyObject *database, double timeout,
else {
Py_INCREF(isolation_level);
}
PyObject *res = PyObject_CallFunction(factory, "NdiOiOii",
PyOS_FSPath(database),
PyObject *res = PyObject_CallFunction(factory, "OdiOiOii", database,
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;
}
Expand Down
0