summaryrefslogtreecommitdiff
path: root/Modules/clinic
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-02-26 06:25:40 -0800
committerGitHub <noreply@github.com>2018-02-26 06:25:40 -0800
commita9e0b070b3e36701d0139361c769d374c4aacf1a (patch)
treebabb8e457884a5d0fb852b7c7df9d77d9e941db7 /Modules/clinic
parent4cffe2f66b581fa7538f6de884d54a5c7364d8e0 (diff)
downloadcpython-git-a9e0b070b3e36701d0139361c769d374c4aacf1a.tar.gz
bpo-32922: dbm.open() now encodes filename with the filesystem encoding. (GH-5832)
(cherry picked from commit 6f600ff1734ca2fdcdd37a809adf8130f0d8cc4e) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Modules/clinic')
-rw-r--r--Modules/clinic/_dbmmodule.c.h8
-rw-r--r--Modules/clinic/_gdbmmodule.c.h13
2 files changed, 11 insertions, 10 deletions
diff --git a/Modules/clinic/_dbmmodule.c.h b/Modules/clinic/_dbmmodule.c.h
index 63d5b1a41f..0f831c9eec 100644
--- a/Modules/clinic/_dbmmodule.c.h
+++ b/Modules/clinic/_dbmmodule.c.h
@@ -121,18 +121,18 @@ PyDoc_STRVAR(dbmopen__doc__,
{"open", (PyCFunction)dbmopen, METH_FASTCALL, dbmopen__doc__},
static PyObject *
-dbmopen_impl(PyObject *module, const char *filename, const char *flags,
+dbmopen_impl(PyObject *module, PyObject *filename, const char *flags,
int mode);
static PyObject *
dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
{
PyObject *return_value = NULL;
- const char *filename;
+ PyObject *filename;
const char *flags = "r";
int mode = 438;
- if (!_PyArg_ParseStack(args, nargs, "s|si:open",
+ if (!_PyArg_ParseStack(args, nargs, "U|si:open",
&filename, &flags, &mode)) {
goto exit;
}
@@ -141,4 +141,4 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
exit:
return return_value;
}
-/*[clinic end generated code: output=8ce71abac849155f input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5c858b4080a011a4 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/_gdbmmodule.c.h b/Modules/clinic/_gdbmmodule.c.h
index 2222967aaa..7bdc4321df 100644
--- a/Modules/clinic/_gdbmmodule.c.h
+++ b/Modules/clinic/_gdbmmodule.c.h
@@ -234,23 +234,24 @@ PyDoc_STRVAR(dbmopen__doc__,
{"open", (PyCFunction)dbmopen, METH_FASTCALL, dbmopen__doc__},
static PyObject *
-dbmopen_impl(PyObject *module, const char *name, const char *flags, int mode);
+dbmopen_impl(PyObject *module, PyObject *filename, const char *flags,
+ int mode);
static PyObject *
dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
{
PyObject *return_value = NULL;
- const char *name;
+ PyObject *filename;
const char *flags = "r";
int mode = 438;
- if (!_PyArg_ParseStack(args, nargs, "s|si:open",
- &name, &flags, &mode)) {
+ if (!_PyArg_ParseStack(args, nargs, "U|si:open",
+ &filename, &flags, &mode)) {
goto exit;
}
- return_value = dbmopen_impl(module, name, flags, mode);
+ return_value = dbmopen_impl(module, filename, flags, mode);
exit:
return return_value;
}
-/*[clinic end generated code: output=dc0aca8c00055d02 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=dec05ff9c5aeaeae input=a9049054013a1b77]*/