diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2019-10-13 11:59:31 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-13 11:59:31 +0300 |
commit | 140a7d1f3579e778656a6b6bfad72489e9870a4d (patch) | |
tree | e9f37d4c49944e9c00e83baaaff6dd785356b29e /Modules/posixmodule.c | |
parent | 46113e0cf32748f66cf64cd633984d143b433cd1 (diff) | |
download | cpython-git-140a7d1f3579e778656a6b6bfad72489e9870a4d.tar.gz |
bpo-38378: Rename parameters "out" and "in" of os.sendfile(). (GH-16742)
They conflicted with keyword "in".
Also rename positional-only parameters of private os._fcopyfile()
for consistency.
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r-- | Modules/posixmodule.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index aeb0e9ddb1..3c4e254abb 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -8993,10 +8993,10 @@ os_write_impl(PyObject *module, int fd, Py_buffer *data) #ifdef HAVE_SENDFILE PyDoc_STRVAR(posix_sendfile__doc__, -"sendfile(out, in, offset, count) -> byteswritten\n\ -sendfile(out, in, offset, count[, headers][, trailers], flags=0)\n\ +"sendfile(out_fd, in_fd, offset, count) -> byteswritten\n\ +sendfile(out_fd, in_fd, offset, count[, headers][, trailers], flags=0)\n\ -> byteswritten\n\ -Copy count bytes from file descriptor in to file descriptor out."); +Copy count bytes from file descriptor in_fd to file descriptor out_fd."); /* AC 3.5: don't bother converting, has optional group*/ static PyObject * @@ -9016,8 +9016,7 @@ posix_sendfile(PyObject *self, PyObject *args, PyObject *kwdict) off_t sbytes; struct sf_hdtr sf; int flags = 0; - /* Beware that "in" clashes with Python's own "in" operator keyword */ - static char *keywords[] = {"out", "in", + static char *keywords[] = {"out_fd", "in_fd", "offset", "count", "headers", "trailers", "flags", NULL}; @@ -9133,7 +9132,7 @@ done: #else Py_ssize_t count; PyObject *offobj; - static char *keywords[] = {"out", "in", + static char *keywords[] = {"out_fd", "in_fd", "offset", "count", NULL}; if (!PyArg_ParseTupleAndKeywords(args, kwdict, "iiOn:sendfile", keywords, &out, &in, &offobj, &count)) @@ -9170,8 +9169,8 @@ done: /*[clinic input] os._fcopyfile - infd: int - outfd: int + in_fd: int + out_fd: int flags: int / @@ -9179,13 +9178,13 @@ Efficiently copy content or metadata of 2 regular file descriptors (macOS). [clinic start generated code]*/ static PyObject * -os__fcopyfile_impl(PyObject *module, int infd, int outfd, int flags) -/*[clinic end generated code: output=8e8885c721ec38e3 input=69e0770e600cb44f]*/ +os__fcopyfile_impl(PyObject *module, int in_fd, int out_fd, int flags) +/*[clinic end generated code: output=c9d1a35a992e401b input=1e34638a86948795]*/ { int ret; Py_BEGIN_ALLOW_THREADS - ret = fcopyfile(infd, outfd, NULL, flags); + ret = fcopyfile(in_fd, out_fd, NULL, flags); Py_END_ALLOW_THREADS if (ret < 0) return posix_error(); |