cpython: 99e118951a80 (original) (raw)

Mercurial > cpython

changeset 73410:99e118951a80

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. [#13327]

Brian Curtin brian@python.org
date Sun, 06 Nov 2011 13:41:17 -0600
parents 106f9e1ad7ab
children 00d4d6b85a01
files Doc/library/os.rst Lib/test/test_os.py Misc/NEWS Modules/posixmodule.c
diffstat 4 files changed, 37 insertions(+), 18 deletions(-)[+] [-] Doc/library/os.rst 21 Lib/test/test_os.py 15 Misc/NEWS 3 Modules/posixmodule.c 16

line wrap: on

line diff

--- 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

--- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -270,6 +270,21 @@ class StatAttributeTests(unittest.TestCa st2 = os.stat(support.TESTFN) self.assertEqual(st2.st_mtime, int(st.st_mtime-delta))

+ # Restrict test to Win32, since there is no guarantee other # systems support centiseconds if sys.platform == 'win32':

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,9 @@ What's New in Python 3.3 Alpha 1? Core and Builtins ----------------- +- Issue #13327: Remove the need for an explicit None as the second argument

--- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -3543,7 +3543,7 @@ static PyObject * posix_utime(PyObject *self, PyObject *args) { #ifdef MS_WINDOWS

@@ -3571,7 +3571,7 @@ posix_utime(PyObject *self, PyObject *ar are also valid. */ PyErr_Clear();

@@ -3589,7 +3589,7 @@ posix_utime(PyObject *self, PyObject *ar Py_DECREF(oapath); }

@@ -3633,13 +3633,13 @@ done: time_t atime, mtime; long ausec, musec; int res;

-

+