summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMartin Panter <vadmium>2015-09-09 01:56:53 (GMT)
committerMartin Panter <vadmium>2015-09-09 01:56:53 (GMT)
commit0ff89099c7f1c848c0df3f7f2220b26e08b939da (patch)
treee207a8fe6251a50e6f1b3bb8fee21b916a8a49cb /Modules
parentdfcfe133001d8d6a8af05f1ce45d7c14ffd1a588 (diff)
parentbf19d169504823c258a9aae4bf61c8df9ff5987f (diff)
downloadcpython-0ff89099c7f1c848c0df3f7f2220b26e08b939da.zip
cpython-0ff89099c7f1c848c0df3f7f2220b26e08b939da.tar.gz
cpython-0ff89099c7f1c848c0df3f7f2220b26e08b939da.tar.bz2
Issue #23738: Merge 3.4 into 3.5
Diffstat (limited to 'Modules')
-rw-r--r--Modules/clinic/posixmodule.c.h6
-rw-r--r--Modules/posixmodule.c15
2 files changed, 11 insertions, 10 deletions
diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h
index 98eeae4..9ef702a 100644
--- a/Modules/clinic/posixmodule.c.h
+++ b/Modules/clinic/posixmodule.c.h
@@ -1487,10 +1487,10 @@ PyDoc_STRVAR(os_utime__doc__,
"\n"
"If times is not None, it must be a tuple (atime, mtime);\n"
" atime and mtime should be expressed as float seconds since the epoch.\n"
-"If ns is not None, it must be a tuple (atime_ns, mtime_ns);\n"
+"If ns is specified, it must be a tuple (atime_ns, mtime_ns);\n"
" atime_ns and mtime_ns should be expressed as integer nanoseconds\n"
" since the epoch.\n"
-"If both times and ns are None, utime uses the current time.\n"
+"If times is None and ns is unspecified, utime uses the current time.\n"
"Specifying tuples for both times and ns is an error.\n"
"\n"
"If dir_fd is not None, it should be a file descriptor open to a directory,\n"
@@ -5788,4 +5788,4 @@ exit:
#ifndef OS_SET_HANDLE_INHERITABLE_METHODDEF
#define OS_SET_HANDLE_INHERITABLE_METHODDEF
#endif /* !defined(OS_SET_HANDLE_INHERITABLE_METHODDEF) */
-/*[clinic end generated code: output=f3f92b2d2e2c3fe3 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=95824c52fd034654 input=a9049054013a1b77]*/
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index d8bb060..5697495 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -4679,7 +4679,7 @@ os.utime
dir_fd: dir_fd(requires='futimensat') = None
follow_symlinks: bool=True
-# "utime(path, times=None, *, ns=None, dir_fd=None, follow_symlinks=True)\n\
+# "utime(path, times=None, *[, ns], dir_fd=None, follow_symlinks=True)\n\
Set the access and modified time of path.
@@ -4689,10 +4689,10 @@ On some platforms, path may also be specified as an open file descriptor.
If times is not None, it must be a tuple (atime, mtime);
atime and mtime should be expressed as float seconds since the epoch.
-If ns is not None, it must be a tuple (atime_ns, mtime_ns);
+If ns is specified, it must be a tuple (atime_ns, mtime_ns);
atime_ns and mtime_ns should be expressed as integer nanoseconds
since the epoch.
-If both times and ns are None, utime uses the current time.
+If times is None and ns is unspecified, utime uses the current time.
Specifying tuples for both times and ns is an error.
If dir_fd is not None, it should be a file descriptor open to a directory,
@@ -4710,7 +4710,7 @@ dir_fd and follow_symlinks may not be available on your platform.
static PyObject *
os_utime_impl(PyModuleDef *module, path_t *path, PyObject *times,
PyObject *ns, int dir_fd, int follow_symlinks)
-/*[clinic end generated code: output=31f3434e560ba2f0 input=1f18c17d5941aa82]*/
+/*[clinic end generated code: output=31f3434e560ba2f0 input=081cdc54ca685385]*/
{
#ifdef MS_WINDOWS
HANDLE hFile;
@@ -8235,10 +8235,10 @@ os_write_impl(PyModuleDef *module, int fd, Py_buffer *data)
#ifdef HAVE_SENDFILE
PyDoc_STRVAR(posix_sendfile__doc__,
-"sendfile(out, in, offset, nbytes) -> byteswritten\n\
-sendfile(out, in, offset, nbytes, headers=None, trailers=None, flags=0)\n\
+"sendfile(out, in, offset, count) -> byteswritten\n\
+sendfile(out, in, offset, count, headers=None, trailers=None, flags=0)\n\
-> byteswritten\n\
-Copy nbytes bytes from file descriptor in to file descriptor out.");
+Copy count bytes from file descriptor in to file descriptor out.");
/* AC 3.5: don't bother converting, has optional group*/
static PyObject *
@@ -8258,6 +8258,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",
"offset", "count",
"headers", "trailers", "flags", NULL};