summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStéphane Wirtel <stephane@wirtel.be>2018-05-01 12:02:26 +0200
committerJulien Palard <julien@palard.fr>2018-05-01 12:02:26 +0200
commit7508a54c77e85235e07e344cf9440e5b4695e9cc (patch)
treef7756a75f3a6affa8d889b5ebfff80e0f5b227aa
parent335a602666d3b94352c194fe002430dda3c0ab2b (diff)
downloadcpython-git-7508a54c77e85235e07e344cf9440e5b4695e9cc.tar.gz
bpo-20709: os.utime(path_to_directory): wrong documentation for Windows. (GH-5469)
Remove the paragraph where we explain that os.utime() does not support a directory as path under Windows. Patch by Jan-Philip Gehrcke Co-authored-by: Jan-Philip Gehrcke <jgehrcke@gmail.com>
-rw-r--r--Doc/library/os.rst14
-rw-r--r--Misc/NEWS.d/next/Documentation/2018-02-01-10-57-24.bpo-20709.1flcnc.rst2
2 files changed, 8 insertions, 8 deletions
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index 2f3b31edd5..2e81459a25 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -2768,14 +2768,12 @@ features:
It is an error to specify tuples for both *times* and *ns*.
- Whether a directory can be given for *path*
- depends on whether the operating system implements directories as files
- (for example, Windows does not). Note that the exact times you set here may
- not be returned by a subsequent :func:`~os.stat` call, depending on the
- resolution with which your operating system records access and modification
- times; see :func:`~os.stat`. The best way to preserve exact times is to
- use the *st_atime_ns* and *st_mtime_ns* fields from the :func:`os.stat`
- result object with the *ns* parameter to `utime`.
+ Note that the exact times you set here may not be returned by a subsequent
+ :func:`~os.stat` call, depending on the resolution with which your operating
+ system records access and modification times; see :func:`~os.stat`. The best
+ way to preserve exact times is to use the *st_atime_ns* and *st_mtime_ns*
+ fields from the :func:`os.stat` result object with the *ns* parameter to
+ `utime`.
This function can support :ref:`specifying a file descriptor <path_fd>`,
:ref:`paths relative to directory descriptors <dir_fd>` and :ref:`not
diff --git a/Misc/NEWS.d/next/Documentation/2018-02-01-10-57-24.bpo-20709.1flcnc.rst b/Misc/NEWS.d/next/Documentation/2018-02-01-10-57-24.bpo-20709.1flcnc.rst
new file mode 100644
index 0000000000..b14c0f54eb
--- /dev/null
+++ b/Misc/NEWS.d/next/Documentation/2018-02-01-10-57-24.bpo-20709.1flcnc.rst
@@ -0,0 +1,2 @@
+Remove the paragraph where we explain that os.utime() does not support a
+directory as path under Windows. Patch by Jan-Philip Gehrcke