summaryrefslogtreecommitdiffstats
path: root/Doc/library/os.rst
diff options
context:
space:
mode:
authorBrian Curtin <brian@python.org>2011-11-06 19:41:17 (GMT)
committerBrian Curtin <brian@python.org>2011-11-06 19:41:17 (GMT)
commit52fbea1d871c99bad3d6f113cebd01ac9c68d5b9 (patch)
tree1532ea1226432b76942a42344fec4b7c1b8b9944 /Doc/library/os.rst
parent9589ab174577773c48492b4e2ad596d4b9c3b120 (diff)
downloadcpython-52fbea1d871c99bad3d6f113cebd01ac9c68d5b9.zip
cpython-52fbea1d871c99bad3d6f113cebd01ac9c68d5b9.tar.gz
cpython-52fbea1d871c99bad3d6f113cebd01ac9c68d5b9.tar.bz2
Fix #13327. Remove the need for an explicit None as the second argument to
os.utime in order to update to the current time. The second argument is now optional.
Diffstat (limited to 'Doc/library/os.rst')
-rw-r--r--Doc/library/os.rst21
1 files changed, 11 insertions, 10 deletions
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index fb794d3..76ad7e0 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -2134,18 +2134,19 @@ Files and Directories
Availability: Unix, Windows.
-.. function:: utime(path, times)
+.. function:: utime(path[, times])
Set the access and modified times of the file specified by *path*. If *times*
- is ``None``, then the file's access and modified times are set to the current
- time. (The effect is similar to running the Unix program :program:`touch` on
- the path.) Otherwise, *times* must be a 2-tuple of numbers, of the form
- ``(atime, mtime)`` which is used to set the access and modified times,
- respectively. 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`.
+ is ``None`` or not specified, then the file's access and modified times are
+ set to the current time. (The effect is similar to running the Unix program
+ :program:`touch` on the path.) Otherwise, *times* must be a 2-tuple of
+ numbers, of the form ``(atime, mtime)`` which is used to set the access and
+ modified times, respectively. 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`.
Availability: Unix, Windows.